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

Scrolling in results field stutters and spikes CPU usage #622

Closed
mwburke opened this Issue Dec 20, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@mwburke
Copy link

mwburke commented Dec 20, 2018

What did you do?

Scrolled within the results panel to view the data from a query with 33 columns and 100 rows.

Overall CPU usage was around 3% at the time.

What did you expect to happen?

Before I updated to version 1.5 several minutes prior, scrolling in the results panel was smooth.

What actually happened?

Now, when I scroll, the scrolling has a very low frames per second view update and does not scroll smoothly. Additionally, the CPU usage for Postico jumps from ~0.1% to up to 97.4% at the highest.

What software versions are you using?

Postico version:
Version 1.5 (4042)

macOS version:
Version 10.13.3 (17D102)

PostgreSQL version:
PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.5290

@jakob

This comment has been minimized.

Copy link
Owner

jakob commented Dec 21, 2018

Hi!

Thanks for reporting this. I was able to confirm, there is a significant performance regression in scrolling. Profiling shows that the cause of the issue is extremely poor performance of named colors (they are used for dark mode support).

I was able to come up with a workaround for the issue -- we can resolve named colors when we first need them and cache the results. We only need to make sure to invalidate the colors correctly when the user switches between dark mode / light mode.

Can you try the following build and let me know if scrolling is snappy again?

Postico 4087.zip

@newhouse

This comment has been minimized.

Copy link

newhouse commented Dec 21, 2018

I had a similar issue, immediately noticing sluggishness in the "SQL Query" workspace...had to downgrade to 1.4.3.
When I go to the "SQL Query" workspace, I noticed some blinking and color changes to the text, then it stabilizes, but there's a lag in scrolling or even moving the cursor around within the same space.

This download you posted above made things a bit better, but still noticeably sluggish so I have downgraded again.

@mwburke

This comment has been minimized.

Copy link

mwburke commented Dec 21, 2018

Tried the new build. Scrolling seems smoother, but still seeing some significant CPU spikes when doing so.

@jakob

This comment has been minimized.

Copy link
Owner

jakob commented Dec 22, 2018

@mwburke CPU spikes when scrolling are normal, drawing lots of text is CPU intensive.

We could enable "smooth scrolling", which might reduce CPU usage when scrolling slowly, but it would eat up a lot of memory (hundreds of megabytes, especially on large displays)

@newhouse I've only made improvements to the table view, but the same problem with the colors might also affect the text area. I'll see if I can fix it in a similar manner.

@Jurgem

This comment has been minimized.

Copy link

Jurgem commented Jan 3, 2019

I still have a similar problem, and i had to downgrade to 1.4.4 (im using high sierra).
The problem happen when i open the SQL Query editor (terminal) and then appear the "loading bar" of macOS. With the older version it work very well and fast... Maybe is that i have a lot of queries on my SQL Query editor? (like 20000 lines)

@jakob

This comment has been minimized.

Copy link
Owner

jakob commented Jan 15, 2019

@newhouse @Jurgem I've opened a new issue for the SQL Text Editor performance issues you've reported. Can you try the build I posted in issue #629 and let me know if it resolves your problem?

@jakob jakob closed this Jan 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment