Commit dce96b9
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 1b613b1 commit dce96b9
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 | |
|---|---|---|---|
| |||
981 | 981 | | |
982 | 982 | | |
983 | 983 | | |
984 | | - | |
| 984 | + | |
| 985 | + | |
985 | 986 | | |
986 | 987 | | |
987 | | - | |
988 | | - | |
| 988 | + | |
989 | 989 | | |
990 | 990 | | |
991 | 991 | | |
| |||
0 commit comments