Repository navigation
Commit 1ed0508
committed
perf(runtime): drop per-call copies and dead work on the call paths
- JsArgConverter::ConvertArg zero-filled a 1 KB error buffer for every
argument; only a NUL-terminated prefix is ever read, so terminate it
instead.
- The object/cast branch of ConvertArg created an unused JEnv (an
emulated-TLS read) and looked up the runtime for every object argument;
the object manager is now resolved once per converter, and only when a
plain object argument needs it. The destructor skips its JEnv when no
local refs were recorded.
- instrumentation::Frame copied its name into a std::string, so every
TNSPERF() frame (class, extended-class and interface constructors,
GetImplementationObject) heap-allocated for names longer than the SSO
buffer even with instrumentation off. Literal and __func__ names are
now kept as pointers; dynamic names still own a copy.
- The class, extended-class and interface constructor callbacks copied
their class names per `new`; they now pass the stored names by
reference and build the "-defaults" name only when it is needed.1 parent 3db72b5 commit 1ed0508
4 files changed
Lines changed: 22 additions & 22 deletions
File tree
- test-app/runtime/src/main/cpp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
| 250 | + | |
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | 329 | | |
334 | 330 | | |
335 | 331 | | |
| |||
416 | 412 | | |
417 | 413 | | |
418 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
419 | 418 | | |
420 | | - | |
421 | | - | |
| 419 | + | |
| 420 | + | |
422 | 421 | | |
423 | 422 | | |
424 | 423 | | |
| |||
898 | 897 | | |
899 | 898 | | |
900 | 899 | | |
901 | | - | |
| 900 | + | |
902 | 901 | | |
903 | 902 | | |
904 | 903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | | - | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | | - | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1529 | 1529 | | |
1530 | 1530 | | |
1531 | 1531 | | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
| 1532 | + | |
1535 | 1533 | | |
1536 | 1534 | | |
1537 | 1535 | | |
| |||
1584 | 1582 | | |
1585 | 1583 | | |
1586 | 1584 | | |
1587 | | - | |
1588 | 1585 | | |
| 1586 | + | |
1589 | 1587 | | |
1590 | | - | |
| 1588 | + | |
1591 | 1589 | | |
| 1590 | + | |
1592 | 1591 | | |
1593 | 1592 | | |
1594 | 1593 | | |
| |||
1628 | 1627 | | |
1629 | 1628 | | |
1630 | 1629 | | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | 1630 | | |
1635 | 1631 | | |
1636 | 1632 | | |
1637 | 1633 | | |
1638 | | - | |
1639 | | - | |
| 1634 | + | |
| 1635 | + | |
1640 | 1636 | | |
1641 | 1637 | | |
1642 | 1638 | | |
| |||
0 commit comments