Skip to content

Performance of Sorted Linked List library

Mark Peterson edited this page Nov 2, 2017 · 7 revisions

In order to compare the performance of several different methods of dealing with in-memory management of sorted data, I created a test (see perf.js) to measure creating a data set of 100,000 items and then removing 1,000 of them as well as measuring the cost to return the sorted data list.

Sorted Linked List (markpete/SortedLinkedList)

  • LinkedList insert 100000 strings: 860ms
  • LinkedList remove 10000 strings: 235ms
  • Map sort time: 9ms
  • Map insert 100000 strings: 31ms
  • Map remove 10000 strings: 0ms
  • Map sort time: 1029ms
  • SortedMap insert 100000 strings: 565ms
  • SortedMap remove 10000 strings: 132ms
  • SortedMap sort time: 27ms
  • SortedArray insert 100000 strings: 2335ms
  • SortedArray remove 10000 strings: 4120ms
  • SortedArray sort time: 4ms
  • Array insert 100000 strings: 36973ms
  • Array remove 10000 strings: 20004ms
  • Array sort time: 0ms