-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize RichTextCodec #2597
Optimize RichTextCodec #2597
Conversation
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay. |
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2597 +/- ##
==========================================
+ Coverage 64.23% 64.39% +0.16%
==========================================
Files 140 140
Lines 8358 8407 +49
Branches 1604 1608 +4
==========================================
+ Hits 5369 5414 +45
- Misses 2989 2993 +4 ☔ View full report in Codecov by Sentry. |
/claim #2573
I know the issue was only for fixing the encoding performance, but as a welcoming side-effect these changes also improve the overall performance of the RichTextCodec. Also, the rendering of the content-type header is now cached (in a lazy val), so users that reuse the same instance of a
ContentType
will not incur any runtime overhead for encoding it on repeated requests.Breaking(?) changes:
sealed abstract class
instead of asealed trait
. This improved performance marginally although I'm happy to revert it if you prefer to have it as a sealed trait instead.Benchmark results
Summary
Parsing:
Encoding:
JMH results (click to expand)
main branch:
PR: