Rich-Harris / pancake

Experimental charting library for Svelte

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Performance regression in 0.0.16 (possibly related to bind:clientWidth?)

francoislg opened this issue · comments

First of all, great package, I love it! :)

I am using this package to render a chart in a table, and it seems to be having performance issues starting with 0.0.16.

I have created a REPL so that you can test it out. Clicking on refresh should give you some number, which is a rough and inaccurate estimate of the time it took.

Now, run the same thing, but using 0.0.16. You can see it's about 2-3 times slower in the best cases.

When observing performance in the profiler, it seems to be related to style and layout recalculation.

0.0.15:

image

0.0.16:

image

Also, I noticed that some purple appeared during mount (which is what is causing major issues in my website):

0.0.15:

image

0.0.16

image

This looks pretty much like layout thrashing caused by bind:clientWidth and bind:clientHeight, but I could be wrong here.


I'm guessing this is a Svelte issue, but I'm wondering if we could do a quick fix in Pancake to bring back the original performance here