Commit fad3d39
Add fast-path in wrap() and fix double ThreadLocal.get() in getCurrent()
wrap() now short-circuits for String/Number/Boolean before the
instanceof chain. getCurrent() was calling CURRENT_INTERPRETER.get()
twice per invocation; now stores the result in a local variable.
Benchmark: +62% throughput on complexTemplateBenchmark (3,316 -> 5,380 ops/s)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 5dd9187 commit fad3d39
2 files changed
Lines changed: 6 additions & 3 deletions
File tree
- src/main/java/com/hubspot/jinjava
- el
- interpret
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
287 | 290 | | |
288 | 291 | | |
289 | 292 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
977 | 977 | | |
978 | 978 | | |
979 | 979 | | |
980 | | - | |
| 980 | + | |
| 981 | + | |
981 | 982 | | |
982 | 983 | | |
983 | | - | |
984 | | - | |
| 984 | + | |
985 | 985 | | |
986 | 986 | | |
987 | 987 | | |
| |||
0 commit comments