Performance: Lazy load Charset in EciMode#107
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #107 +/- ##
============================================
+ Coverage 87.25% 87.26% +0.01%
Complexity 4299 4299
============================================
Files 68 68
Lines 13934 13938 +4
Branches 3254 3254
============================================
+ Hits 12158 12163 +5
+ Misses 1126 1125 -1
Partials 650 650 ☔ View full report in Codecov by Sentry. |
|
I'm not sure this is worth the hassle, this initialization only happens once in the lifetime of the VM, right? Were you benchmarking a single call to |
6be3c80 to
76871a8
Compare
Yes, I think this only is expensive once per VM lifetime. Remark: In my tax use-case, the reference implementation is a Java CLI tool, which starts once per tax report PDF. That means, this initialization happens once per PDF. It is not too much of course, but in case you generate thousands of PDFs it still sums up a bit. If you feel like it blows up the code too much, I am also OK with closing this PR. |
|
Understood -- let's keep this one open as a future option, but I'm not sure it's worth it right now. By the way, have you tried Graal for this use case? It might be a good fit... |
In my profilings,
Symbol#eciProcesscallingCharset#forNameshows up quite slow (50ms). With this optimization, it no longer shows up, thusPdf417#encodegoes down from 190ms to 140ms.Before:

After:
