uruk-project / Jwt

JSON Web Token implementation for .Net & .Net Core
MIT License
84 stars 13 forks source link

Use SIMD instructions for Base64Url encoding. #393

Closed ycrumeyrolle closed 4 years ago

ycrumeyrolle commented 4 years ago

Reuse @gfoidl work.

ycrumeyrolle commented 4 years ago

The TryDecode takes 0.8% of the JWT global decoding. The GetMaxDecodedLength takes 0.58%. This method might be optimized...

ycrumeyrolle commented 4 years ago

The GetMaxDecodedLength takes 0.58%. This method might be optimized...

Change the control flow, now takes about 0.03%.

gfoidl commented 4 years ago

I'd love to see the nuget-package used instead of copying the code :wink: If there's something missing in the package or your perf-measures don't meet the expectations, file an issue, so that the product can be improved and every user can get the benefit of this improvement. That's the idea of open-source.

I've no problem with copying anyway. It's just about improving something that can be used by a broader audience, instead of island-solutions.

ycrumeyrolle commented 4 years ago

I am fully agree with you. The source code duplication may be temporary for this version. This is too painful to maintain, and there are too many perf tweaks.

Nevertheless this give me the opportunity the manipulate the code for my use case and to identify some rooms of improvement. Don't worry, I have some issues ready to open for you 😄

gfoidl commented 4 years ago

Fine 👍 Thanks for the update on this topic.

Don't worry, I have some issues ready to open for you

Nice :smiley: Let's see if we can adopt everything so it fits the needs and has super perf...