Files
xterm.js/src
Benjamin Woodruff 8b3b7535c6 Add a new LRUMap class, remove uses of Map
LRUMap implements the parts of an ordered map that we need to
efficiently implement DynamicCharAtlas. It's more code, but there's a
few advantages of this approach:

- Map isn't available on some older browsers, so this removes the need
  for a polyfill.

- Moving an item to the end of the map's iteration order now only
  requires unlinking and linking a linked-list node, whereas before we
  had to delete and re-insert our value.

- Peeking at the oldest entry in the map no longer requires allocating
  and destroying an iterator.

- We can preallocate the linked-list nodes we want to improve cache
  locality. Similarly, we can recycle linked-list nodes to reduce
  allocations and the GC pauses those allocations may cause.

- LRUMap seems to give slightly better results in Chrome's profiler than
  Map did. We now spend about 5% of our time on map operations instead
  of about 10%.

- In my (limited) testing, it doesn't look like LRUMap is slowing down
  over time. Map appeared to get slightly slower the longer I ran the
  terminal for, either due to memory fragmentation or some sort of leak.

I still need to write some tests for LRUMap, but I've been using this
implementation for the last hour without problems.
2018-04-15 18:52:06 -07:00
..
2018-04-05 07:03:09 -07:00
2018-03-08 07:00:37 -08:00
2018-03-16 17:23:17 -07:00
2018-03-19 11:01:26 -07:00
2018-01-25 10:03:28 -08:00
2018-03-20 09:10:48 -07:00
2018-03-20 09:10:48 -07:00
2018-01-17 10:23:27 -08:00
2018-03-11 12:34:27 -07:00
2018-03-16 15:56:48 -07:00
2018-01-27 16:47:23 -08:00
2018-03-08 06:19:17 -08:00
2017-09-08 10:16:42 -07:00