# ProfileView.jl makes my computer lag

**URL:** <https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729>\
**Category:** General Usage\
**Tags:** profile\
**Created:** [May 12, 2023, 10:02am UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729 "2023-05-12T10:02:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 12, 2023, 10:02am UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/1 "2023-05-12T10:02:38Z")

</div>

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:

```julia
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

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 12, 2023, 10:17am UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/2 "2023-05-12T10:17:36Z")

</div>

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

```julia
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?

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 12, 2023, 10:43am UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/3 "2023-05-12T10:43:55Z")

</div>

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.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/0/d/0d80fa40a5f235cd45a6b4146e8778c2aeb2bfbb.png)

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

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/2/f2726b0c47d0eb49ef5e0760a17c6e561763f8ae.png)

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.

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 12, 2023, 10:50am UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/4 "2023-05-12T10:50:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 12, 2023, 11:20am UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/5 "2023-05-12T11:20:24Z")

</div>

Okay, I can reproduce this and it looks like

> <https://github.com/timholy/ProfileView.jl/issues/205>
>
> I'm on Windows 10, Julia 1.7.0.
> 
> Running \`using ProfileView\` (after it's insta…lled in the current env, v1.5.1) makes the keyboard unresponsive or very slow to respond, for about 30 seconds after the command has returned.
> In addition, if have an \[AutoHotkey\](https://www.autohotkey.com/) script running during the import command, the script stops working and I have to restart it.
> 
> It's not a big issue; I'm just posting this here for if there are other Julia users with this problem and wondering where it comes from (I had a large list of packages imported, and by elimination narrowed the problem down to ProfileView).
> 
> edit: still in Julia 1.8.1

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

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 12, 2023, 11:24am UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/6 "2023-05-12T11:24:05Z")

</div>

Neat, thanks a lot !

---

<div class="post-metadata">

**Author:** ![marcsgil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcsgil/32/33908_2.png) [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Post date:** [May 12, 2023, 1:28pm UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/7 "2023-05-12T13:28:55Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 12, 2023, 1:45pm UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/8 "2023-05-12T13:45:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![marcsgil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcsgil/32/33908_2.png) [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Post date:** [May 12, 2023, 4:07pm UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/9 "2023-05-12T16:07:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mariusd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mariusd/32/23231_2.png) [@mariusd](https://discourse.julialang.org/u/mariusd)\
**Post date:** [August 9, 2023, 10:04pm UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/10 "2023-08-09T22:04:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GeorgeTheFifth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/georgethefifth/32/205718_2.png) [@GeorgeTheFifth](https://discourse.julialang.org/u/GeorgeTheFifth)\
**Post date:** [January 3, 2024, 4:27pm UTC](https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/98729/11 "2024-01-03T16:27:18Z")

</div>

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

```julia
Error: Tree Hash Mismatch!

```

[issue](https://github.com/JuliaLang/Pkg.jl/issues/1860) while installing the package.
