ProfileView.jl makes my computer lag

Hello,

Since I’ve updated to 1.9, julia makes my computer extremely slow. Note that I also tried with 1.8.5 and it also happens, it coincides with me upgrading to 1.9, but doesn’t seem linked to the version itself.
I’m talking about a ~2 sec input lag when typing text (anywhere, not just in the REPL). This happens when starting julia from windows powershell, via juliaup, or in VS Code. I never had such a problem before.

I tried completely deleting .julia after uninstalling all versions but a fresh reinstall doesn’t solve it.

Here are my system specs:

Processor:	AMD Ryzen 9 5900X 12-Core Processor               3.70 GHz
RAM: 16,0 Go (15,9 Go usable)
Windows 11 v22H2 

Update: When going to 1.9 I also followed workflow tips and created a startup.jl file. I tried rm packages from the 1.9 enviroment and it turns out that Revise is the culprit. Removing it completely solves the problem. Any idea why revise would slow down a system like that ? I’d like to be able to use it…
Update 2: Revise may not be the cause, see below.
Update 3: I can reproduce with ProfileView

2 Likes

I can’t reproduce this on Julia 1.9, Windows 10. What version of Revise are you using?

Just to be sure you are saying doing

powershell> julia

julia> using Revise

leads to your entire system slowing down (i.e. text input in non-Julia applications is affected as well)? What does the resource monitor say?

No this doesn’t reproduce. It stopped lagging when I did rm Revise and restart julia. But now I’ve added it back and entered using Revise, no lag. I don’t understand. One thing is sure though is that it only happens when Julia is running.

I uncommented the import Revise in my startup.jl and then restarting again makes the process lag.

Here’s a snapshot of my RM when lagging. It’s in French but it should be pretty straightforward to understand.

No visible change in ressources utilization either (taken 5 secs after starting julia):

Then, I tried commenting all imports in my startup.jl but Revise, and it does not lag. So, I’m changing the title because indeed I jumped too soon to the conclusion that Revise is the culprit. But it seems like startup packages may be the cause (I have Profile, ProfileView, BenchmarkTools, OhMyREPL, Pkg and Revise). Though not one specifically.

1 Like

After uncommenting each one by one, ProfileView seems to be the one package that slows everything down. I don’t know why it was briefly solved by removing Revise but not importing ProfileView seems to work. I can live without it in my startup, but this is weird regardless.

1 Like

Okay, I can reproduce this and it looks like

so it’s some downstream GTK issue apparently. Workaround in the issue above.

2 Likes

Neat, thanks a lot !

I had the same problem when using ImageView and found that the presented solution works for me, more or less. The thing is, I’m planning to use ImageView in a package I’m developing, and I couldn’t figure out how to modify the environment variable from inside the package. Is there a way to do this so that users of my package don’t have to manually run ENV["GTK_AUTO_IDLE"] = false ? Any help would be greatly appreciated. Thank you!

1 Like

You can add the ENV["GTK_AUTO_IDLE"] = false line to your startup.jl file (are you familiar with it?).
I don’t know what side effects this may have but at least you don’t have to do it manually.

Thank you for your suggestion, I’m familiar with it. But my goal is to make it as easy as possible for potential users of my package, so I’d like to avoid adding this extra configuration step if possible.

Just run into the same issue, and yes, Gtk (used by ProfileView) causes this in my Windows 10 computer.

I am experiencing the same issue on Windows 10. Basically, the package is broken in its current state, since it cannot be used properly. I also had

Error: Tree Hash Mismatch!

issue while installing the package.