diff options
author | John Högberg <[email protected]> | 2018-10-15 18:17:12 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2018-11-05 09:18:07 +0100 |
commit | d98da38562ec79360b58eed87eced3a506f1ff6d (patch) | |
tree | 4946a629854e4a65ae751bebc177390bc36450f8 /lib/stdlib/test/binary_module_SUITE.erl | |
parent | 53e7743216647d810d529e397bd3ea7278c6047c (diff) | |
download | otp-d98da38562ec79360b58eed87eced3a506f1ff6d.tar.gz otp-d98da38562ec79360b58eed87eced3a506f1ff6d.tar.bz2 otp-d98da38562ec79360b58eed87eced3a506f1ff6d.zip |
Optimize operator '--' and yield on large inputs
The removal set now uses a red-black tree instead of an array on
large inputs, decreasing runtime complexity from `n*n` to
`n*log(n)`. It will also exit early when there are no more items
left in the removal set, drastically improving performance and
memory use when the items to be removed are present near the head
of the list.
This got a lot more complicated than before as the overhead of
always using a red-black tree was unacceptable when either of the
inputs were small, but this compromise has okay-to-decent
performance regardless of input size.
Co-authored-by: Dmytro Lytovchenko <[email protected]>
Diffstat (limited to 'lib/stdlib/test/binary_module_SUITE.erl')
0 files changed, 0 insertions, 0 deletions