diff options
| author | eunhhu <[email protected]> | 2026-10-19 05:16:07 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-19 05:16:07 +0100 |
| commit | 5df2e814937e32a54c77c1ded66b5124e6017cfc (patch) | |
| tree | 637057a33091f61e7b2a9516fe6ccc4544799655 /core | |
| parent | c80ac23fd74fe07e7e02514486fd0ecfbc8da779 (diff) | |
| download | pure-5df2e814937e32a54c77c1ded66b5124e6017cfc.tar.gz pure-5df2e814937e32a54c77c1ded66b5124e6017cfc.zip | |
CONCAT with an empty side gives the other as it is, uncopied (values do not change), so a bytes state joined while empty (HTTP's pending + packet.data) no longer copies the packet: HTTP a packet at a time 288 to 270 ns a byte at the same instructions, as the old app (270.0); counts: b48 against b47 knapsack without batches -0.42%, join -0.16%, BFS with batches -0.12%, the rest within 0.03%; the bank's queries (s47 and s48 in turns, six each) in_credit -0.34%, field -0.34%, found -0.22%, per_branch -0.20%, large -0.18%, ranks -0.13%, none the same, the seven answers the same bytes
Diffstat (limited to 'core')
| -rw-r--r-- | core/module.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/module.c b/core/module.c index 621a510..3a6c4b5 100644 --- a/core/module.c +++ b/core/module.c @@ -3980,6 +3980,8 @@ static inline __attribute__((always_inline)) int step(Frame *frame, const PureOp } case PURE_OP_CONCAT: { PureBytes right = stack[--sp].bytes, left = stack[sp - 1].bytes; + if (!right.length) NEXT; /* joined with nothing: the other as it is, uncopied (values do not change) */ + if (!left.length) { stack[sp - 1].bytes = right; NEXT; } size_t start = arena->used; if ((status = append_value(app, arena, left)) != PURE_OK || (status = append_value(app, arena, right)) != PURE_OK) STOPPED(status); |
