idiomorph icon indicating copy to clipboard operation
idiomorph copied to clipboard

Investigate special-casing algorithm for some pathological cases

Open botandrose opened this issue 2 months ago • 0 comments

I want to investigate the following morphs, how they perform now, and if we can improve performance by special-casing any of them:

Setup: A <ul> with 100 <li> children

  1. Append a new item to the end
  2. Remove the last item
  3. Prepend a new item to the beginning
  4. Remove the first item
  5. Insert a new item in the middle
  6. Remove the middle item

I think the current algorithm will do very well on some of these, and terrible on others. I'd like to see if we can improve performance by doing a little planning at the beginning of morphChildren, and then selecting a more optimal strategy.

botandrose avatar Oct 20 '25 16:10 botandrose