Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

◐ Spin Pkg terminal spinners with CSS for performance #2787

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Jan 22, 2024

#2500 introduced two performance issues:

  1. High network pressure and latency Fancyprint pkg logs: not throttled on slow connection #2739
  2. The terminal outputs are stored in the state, and are included in every codemirror as a compartment value (because the terminal text is displayed in the Pkg popup). This was causing lots of expensive re-renders. According the the profile, most time was spent in the CM6 compartment/extension state management.

The solution in this PR is to replace all 4 progress characters with on the server side (before diffing). This fixes both issues because the updates are now much less frequent.

To still get a spinning animation, we search for the character, give it a class and make it spin with a CSS animation. The result is almost identical!

Before

Schermopname.2024-01-22.om.11.06.57.mov
Scherm­afbeelding 2024-01-22 om 11 07 29

After

Schermopname.2024-01-22.om.11.27.16.mov
Scherm­afbeelding 2024-01-22 om 11 04 15
You can see that there are much fewer messages from the server:
Schermopname.2024-01-22.om.11.33.11.mov

fix #2739

@fonsp fonsp added frontend Concerning the HTML editor HTTP/WS The connection between backend and frontend performance labels Jan 22, 2024
Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="pkg-terminal-spinners-with-css")
julia> using Pluto

@fonsp fonsp changed the title Spin ◐ Pkg terminal spinners with CSS for performance ◐ Spin Pkg terminal spinners with CSS for performance Jan 22, 2024
@fonsp fonsp merged commit a617193 into main Jan 22, 2024
15 of 16 checks passed
@fonsp fonsp deleted the pkg-terminal-spinners-with-css branch January 22, 2024 21:51
@fonsp
Copy link
Owner Author

fonsp commented Jan 22, 2024

I'm really proud of this PR 😙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Concerning the HTML editor HTTP/WS The connection between backend and frontend performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fancyprint pkg logs: not throttled on slow connection
1 participant