Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Validate performance of JWT string validation by decoding vs basic string match
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Browser:
Chrome 120
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
decodeAndTest()
838968.5 Ops/sec
testWithoutDecoding()
6376680.5 Ops/sec
Script Preparation code:
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiY3VzdG9tZXJfaWQiOiJqb2huZG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.ScbjLEXxqzZQ9JEw5yQu2MLlGsLhHzMlg7aZHZnH4Ro"; function decodeAndTest() { return "customer_id" in JSON.parse(atob(token.split(".")[1])); } var encodedCustId = "Y3VzdG9tZXJfaWQ="; function testWithoutDecoding() { return token.indexOf(encodedCustId) >= 0; }
Tests:
decodeAndTest()
decodeAndTest()
testWithoutDecoding()
testWithoutDecoding()