ArrayEditable tooltip performance improvements #2919

Closed
opened 2016-05-04 14:33:07 +00:00 by wjt · 3 comments

I spent a bit of time profiling to make updating the list of items a bit faster. The big win is creating one Ox.Tooltip for the whole , and making Element's setTooltip speedier when there is no tooltip. Adding & removing 1000 items in a contrived (but I think relatively realistic) benchmark is about 2× faster with this branch.

On https://gitlab.com/wjt/oxjs.git :

  • ArrayEditable-performance holds the patches
  • ArrayEditable-performance-benchmark holds the little benchmark

Ox.typeOf and GC both show up pretty high (~20% between them) in a profiler. I don't think it helps that every call to Ox.typeOf allocates a (tiny) string, so you end up with loads of minor GC pauses. I experimented with a fast path using a combination of typeof and Array.isArray with no real success, though...

Another possible improvement for ArrayEditable might be to update existing Editable child elements in-place (where possible), rather than deleting and recreating them each time.

I spent a bit of time profiling <ArrayEditable> to make updating the list of items a bit faster. The big win is creating one Ox.Tooltip for the whole <ArrayEditable>, and making Element's setTooltip speedier when there is no tooltip. Adding & removing 1000 items in a contrived (but I think relatively realistic) benchmark is about 2× faster with this branch. On <https://gitlab.com/wjt/oxjs.git> : * `ArrayEditable-performance` holds the patches * `ArrayEditable-performance-benchmark` holds the little benchmark `Ox.typeOf` and GC both show up pretty high (~20% between them) in a profiler. I don't think it helps that every call to `Ox.typeOf` allocates a (tiny) string, so you end up with loads of minor GC pauses. I experimented with a fast path using a combination of `typeof` and `Array.isArray` with no real success, though... Another possible improvement for `ArrayEditable` might be to update existing `Editable` child elements in-place (where possible), rather than deleting and recreating them each time.
j added the
oxjs
label 2016-05-04 14:33:07 +00:00
j added this to the 14.04 milestone 2016-05-04 14:33:07 +00:00
rlx was assigned by j 2016-05-04 14:33:07 +00:00
j added the
normal
enhancement
labels 2016-05-04 14:33:07 +00:00
Owner

merged the performance branch but did not merge benchmark since it requires .git and crashed my chrome tab...

merged the performance branch but did not merge benchmark since it requires .git and crashed my chrome tab...
Author

Yikes!

I guess I didn't really intend the benchmark to be merged, it's just what I was working with in case you were interested – but if you'd like I can spend some time cleaning it up, removing the .git dependency and investigating why it crashes your browser – maybe the set of test elements is just too large?

Yikes! I guess I didn't really intend the benchmark to be merged, it's just what I was working with in case you were interested – but if you'd like I can spend some time cleaning it up, removing the `.git` dependency and investigating why it crashes your browser – maybe the set of test elements is just too large?
Owner

no need to rework the benchmark, it's good for testing but not needed on oxjs examples page. will keep a copy and try to use console.profile, have not used it so far..

I get some output if I reduce the Ox.loop so might be just to large or encoding videos int he background makes my computer to slow...

no need to rework the benchmark, it's good for testing but not needed on oxjs examples page. will keep a copy and try to use console.profile, have not used it so far.. I get some output if I reduce the Ox.loop so might be just to large or encoding videos int he background makes my computer to slow...
j added the
fixed
label 2016-06-23 16:32:32 +00:00
j closed this issue 2016-06-23 16:32:32 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: 0x2620/pandora#2919
No description provided.