fastai / fastprogress

Simple and flexible progress bar for Jupyter Notebook and console
Apache License 2.0
1.08k stars 105 forks source link

Move the style overrides to a separate HTML widget #79

Closed jpc closed 3 years ago

jpc commented 3 years ago

Updating the styles every time we update the widget causes Safari to recalculate the styles and the layout for the whole notebook which completely ruins performance (100ms layouts on each update on an Apple M1). If we output the styles as a separate widget the browser only interprets them once and layout times on updates stay < 10ms.

review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

gkossakowski commented 3 years ago

I just verified that this patch indeed fixes perf issues with progress bar in Safari. Specifically, I manually patched my local fastprogress package install and see CPU usage dropping from 100% to <2% while progress bar is updating in Safari.

@sgugger it would be great to get this patch in!

sgugger commented 3 years ago

Looks good to me! Thanks for fixing!

jpc commented 2 years ago

Hi, thanks for merging my change. Could we release a new minor version of the package? Installing from the repo is currently the only way to make fastai usable in Safari.

jph00 commented 2 years ago

Many apologies for the extremely slow release of this @jpc -- done now. (And thanks for the reminder)