Hacker News new | ask | show | jobs
by Narishma 1187 days ago
I would absolutely expect any drawing application to drop to 0% when I'm not interacting with it. That's the norm with native applications, it shouldn't be any different for a web app.
1 comments

While I don't fully disagree with that, I just opened up Gimp and moving my mouse around made the cpu spike. That's with no brush selected or anything, just the default select tool and a completely blank screen. And yes, you can absolutely get more performance out of a native app than a web app, an editor built in javascript will always be less performant than one built in C++ or whatever something like Photoshop or Gimp is made in. That was a tradeoff I made to make something that was available to a wider audience instead of being locked down to a particular operating system.

I'm sure there's more improvements I could make on performance, maybe I could switch to only drawing the mouse cursor on the mousemove event rather than using the animation loop, but then when you're tweaking values in the menus, you won't see your changes in real time any more. It's all a balance, and this is just something I do in my spare time, I'd rather have fun building some new features than seeing my cpu usage drop by a percentage point.

I am not "moving my mouse around", in fact it is not even on top of that window. As am I currently in this HN window typing this comment, the app is still using 100% of a CPU core.
Like I said, I'm using an animation loop, so of course it's going to keep doing things while the user isn't actively interacting. I fully agree there's ways to still improve it, and I might look into switching to entirely event based refreshing, but the 100% cpu core is due to your web browser being unable to offload the svg filters to your gpu. Maybe that's due to your gpu, maybe it's your operating system or web browser that's the problem, I don't know, but that's why people release things as a beta before fully releasing something. Hopefully I can work out most of those kinks, and people giving helpful feedback during beta makes that a lot easier!

For another data point, on my half decent desktop, it uses about 10% cpu and 20% gpu