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

X server CPU utilization is pegged at idle while Runebender glyph editor is open #234

Open
xorgy opened this issue Mar 26, 2021 · 11 comments
Labels
perf platform/linux This issue is specific to linux

Comments

@xorgy
Copy link
Member

xorgy commented Mar 26, 2021

When the Runebender glyph editor has a glyph open, it is doing something with the X server that is causing it to use all or most of a core.

@xorgy
Copy link
Member Author

xorgy commented Mar 26, 2021

Whatever it is that causes this, it is less severe when using the Preview tool.

@cmyr cmyr added the perf label Apr 1, 2021
@cmyr
Copy link
Member

cmyr commented Apr 1, 2021

Interesting. we definitely haven't been testing as thoroughly on linux, so this could be an issue here or in druid. If you had a chance to run it through a profiler and see where the hot spots are that would be very welcome, otherwise I'll investigate at some point.

@cmyr cmyr added the platform/linux This issue is specific to linux label Apr 1, 2021
@alerque
Copy link

alerque commented Apr 1, 2021

For what it's worth I am unable to replicate this result. With a glyph editor open (whether idle or doing as much as I can in it) Runebender clocks in using 0.5% of one CPU (out of 12). Its hard to find it a top because it barely touches my system resources.

What font sources are you editing?

Did you compile in debug more or release mode?

@xorgy
Copy link
Member Author

xorgy commented Apr 1, 2021

For what it's worth I am unable to replicate this result. With a glyph editor open (whether idle or doing as much as I can in it) Runebender clocks in using 0.5% of one CPU (out of 12). Its hard to find it a top because it barely touches my system resources.

Yeah, upon starting it up again with the same build it is not triggering reliably now. I'll see if I can figure out the sequence to trigger this issue. When I was experiencing this last week, I could start it up and open a glyph editor, and it would immediately spike utilization.

What font sources are you editing?

I experienced this editing several fonts. These, for example: https://github.com/xorgy/twenty-first

Did you compile in debug more or release mode?

I've tried both. Debug mode builds are too slow even to test, it takes about three seconds to draw the screen.

In any event, looks like I'm going to need more investigation to figure out what this is, I'll get back to y'all if I have something more concrete, and I'll use the profiler to capture it if I can.

I'm still getting some significant X server load in some cases, for example when holding keys (i.e. holding space to pan in the glyph editor), though that is much easier to explain than the issue at idle.

@xorgy
Copy link
Member Author

xorgy commented Apr 1, 2021

likethisnow

I caught it doing it again, this is one of the UFOs from that repository I linked. I'll see if I can get anything out of a profile (though maybe an X trace would be better, since the issue is with it tying up 100% on the X server, not with Runebender itself having high CPU utilization.

Any assistance you can offer in figuring out how to trace/profile this issue is greatly appreciated. :+ )

@alerque
Copy link

alerque commented Apr 1, 2021

Your machine is quite a bit beefier than mine (double the ram, double the cores), but I've never been able to discern any difference running with a debeug mode compile vs a release. I don't know where your 3 second draw times are coming in, but screen draws for me are definitely closer to 3 milliseconds than 3 seconds!

I just tried the font you show in your last capture (Twenty First Bold) and this is the first time I can really feel the difference between builds. The glyph editor UI is noticeably laggy. Not 3 seconds laggy, but dragging points around the lines stutter a little bit, as if it was drawing 15 FPS or something. That is with a debug build of the current Runebuilder HEAD. With a release build I can't really tell there is a problem. It doesn't feel like 300 FPS, more like 60, and the curves attached to points I drag around track smoothly but do seem to lag the cursor a few pixels if I slash them around wildly.

@alerque
Copy link

alerque commented Apr 1, 2021

Dost thou wayland?

@xorgy
Copy link
Member Author

xorgy commented Apr 1, 2021

Dost thou wayland?

Erstwhile I hath, nowadays dothn't.

@cmyr
Copy link
Member

cmyr commented Apr 1, 2021

Do you have a lot of windows open? There's a bunch of bad performance stuff I've noticed where we currently refresh all windows whenever you draw, so the more windows you have open the more that would be a problem.

There's some other perf stuff I've noticed where we invalidate way too much stuff when we edit a glyph; this is part of wanting glyph changes to be immediately reflected everywhere, but iirc we aren't being very judicious and this means we have to draw way more often then should really be necessary.

@alerque
Copy link

alerque commented Apr 1, 2021

Do you have a lot of windows open?

The guy doesn't even have window decorations enabled in his window manager, does he sound like the kind of chap that would benchmark with dozens of extra windows of the same app lying around?

@xorgy
Copy link
Member Author

xorgy commented Apr 1, 2021

I have few things actually displayed on the screen, and if you're talking about Runebender windows, just the glyph list and the single glyph editor will set the X server on fire, but only with a glyph editor open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf platform/linux This issue is specific to linux
Projects
None yet
Development

No branches or pull requests

3 participants