diff options
author | John Hawthorn <john@hawthorn.email> | 2021-12-07 15:18:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 15:18:11 -0800 |
commit | 4a3e7984bfbaab45cbd6e73373ee1bba5ce21dc1 (patch) | |
tree | a5ac8d87f9257142393b86dafe7215d2996a8e99 /wince/direct.c | |
parent | 852ea1e893e68952fbeaab1b2e29cd7e0bf61f0a (diff) |
Avoid Array allocation when appending to args array (#5211)
* Use duparray when possible for argspush
ARGSPUSH is the node we see with a single value pushed to the end of a
splatted array. ARGSCAT is similar, but is used when multiple values are
being concatenated to the list.
Previously only ARGSCAT had an optimization where when all the values
were static it would use duparray instead of newarray to create the
intermediate array.
This commit adds similar behaviour for ARGSPUSH, using duparray instead
of putobject/newarray.
* Replace duparray with putobject before concatarray
When performing duparray/concatarray we know we'll never use the
intermediate array being created by duparray, so we should be able to
use it as a temporary object.
This avoids an extra array allocation for NODE_ARGSPUSH (ex. [*foo, 1])
and NODE_ARGSCAT (ex. [*foo, 1, 2]).
Notes
Notes:
Merged-By: jhawthorn <john@hawthorn.email>
Diffstat (limited to 'wince/direct.c')
0 files changed, 0 insertions, 0 deletions