Files
jq/src
Nicolas Williams a9f97e9e61 Fix accidentally quadratic behavior in _modify
We need to be careful to not grab an extra reference when mutating data
structures because that means we make extra copies.  Doing that every
time in `_modify` is really painful, as that function implements `|=`
and all modify-assign operators.

`jv_setpath()` also grabs additional references, so this is not the only
fix needed for the modify-assign operators to not be accidentally
quadratic.

We have to use `LOADVN` in order to make this fix possible, so we should
really byte-code `_modify` rather than jq-code it.  However, as a
stop-gap to make this fix easier, I'm adding syntax for referring to a
`$binding` such that you get `LOADVN` instead of `LOADV`.

This syntax is not meant to be used outside jq's internals!  Therefore
it is not documented.  I promise to break it later, so don't use it!

TBD, but later:

 - Optimize `_modify` for the case where `update` outputs more than one
   value.

   This is trivial: add a `setpath($p; null)` in the middle of `_modify`
   before calling `update`.  But unfortunately the VM retains a
   reference to `value_at_path` for path expression checking, and fixing
   that will require more work.
2021-10-24 16:23:26 -05:00
..
2020-01-02 10:52:12 -06:00
2020-12-19 15:18:29 -05:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2020-01-14 10:18:22 -06:00
2015-08-23 20:36:11 -07:00
2021-10-24 16:23:26 -05:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2015-08-23 20:36:11 -07:00
2021-09-06 22:17:57 -05:00
2020-12-19 15:18:29 -05:00
2015-08-23 20:36:11 -07:00
2017-04-21 18:41:06 -05:00
2015-08-23 20:36:11 -07:00
2018-08-17 23:15:48 -04:00
2020-01-10 12:01:08 -06:00
2015-08-23 20:36:11 -07:00