Skip to content

Commit

Permalink
Optimize operator '--' and yield on large inputs
Browse files Browse the repository at this point in the history
The removal set now uses a red-black tree instead of an array,
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.

Co-authored-by: Dmytro Lytovchenko <dmytro.lytovchenko@erlang-solutions.com>
  • Loading branch information
jhogberg and kvakvs committed Oct 24, 2018
1 parent 6b6ff00 commit 655ef4d
Show file tree
Hide file tree
Showing 6 changed files with 454 additions and 143 deletions.
1 change: 1 addition & 0 deletions erts/emulator/beam/erl_alloc.types
Expand Up @@ -274,6 +274,7 @@ type ML_YIELD_STATE SHORT_LIVED SYSTEM monitor_link_yield_state
type ML_DIST STANDARD SYSTEM monitor_link_dist
type PF3_ARGS SHORT_LIVED PROCESSES process_flag_3_arguments
type SETUP_CONN_ARG SHORT_LIVED PROCESSES setup_connection_argument
type LIST_TRAP SHORT_LIVED PROCESSES list_bif_trap_state

type ENVIRONMENT SYSTEM SYSTEM environment

Expand Down

0 comments on commit 655ef4d

Please sign in to comment.