Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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 (iPhone; CPU iPhone OS 17_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 17
Operating system:
iOS 17.2.1
Device Platform:
Mobile
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
testWithoutDecoding()
7.6M/s
decodeAndTest()
1.8M/s
View exact numbers
Test name
Executions per second
✓
testWithoutDecoding()
7,607,919 Ops/sec
decodeAndTest()
1,839,141 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()