Speed up popup list rebuilds; fix ERB.new for Ruby 4 - #150
Conversation
|
Looks good on reading through. The test is if the build works on my ancient laptop |
ericpromislow
left a comment
There was a problem hiding this comment.
Please update the version to VERSION=3.6.13 (master is currently at 3.6.12 so maybe you should pull master and rebase the fork)
|
The build works with ruby 2.7.1p83 and erb 2.2.0, so that's a good thing |
Sure, happy to bump the current one, but master is showing as |
|
I forgot to push a change that just incremented the version field. It's fixed now. Pls rebase the branch and it should be fine |
- Ruby 4 removed the positional safe_level/trim_mode/eoutvar form - keyword form works on Ruby 2.6+ so 3.x builds are unaffected
- delegate li click/dblclick handlers to the list instead of rebinding per item - append list items via a DocumentFragment rather than one at a time - precompute lowercase sort keys instead of lowercasing on every comparison - restore selection with a Set lookup rather than Array.indexOf - build each item label in a string and assign textContent once
|
@ericpromislow sure, done! |
Two independent changes, one commit each:
Driving the generated popup script with 2000 synthetic tabs shows roughly 1.3x faster filtering per keystroke and a much cheaper select-all path; the win should be larger in a real browser since fewer reflows are triggered. Both the firefox and chrome zips build cleanly with make on Ruby 3.4 and 4.0.