You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it may make sense to create a wrapper around R's list with clear append semantics without copy of the object. Recently R lists (and actually arrays) seems improved a lot in a sense that they don't make copies with each append. But this is not widely known.
In PriorityQueue, the memory is first pre-allocated and the memory is reallocated and doubled if we hit the memory cap. While it's a bit memory inefficient, but we trade memory for speed. We may also implement this expanding memory idea to List.
I think it may make sense to create a wrapper around R's list with clear
append
semantics without copy of the object. Recently R lists (and actually arrays) seems improved a lot in a sense that they don't make copies with each append. But this is not widely known.As can be seen it is still better to pre-allocate result, but dynamic resizing is not that bad now (few re-allocations).
The text was updated successfully, but these errors were encountered: