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

Long running query uses 10% CPU on MacBook Pro #610

Closed
jdub opened this Issue Nov 13, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@jdub

jdub commented Nov 13, 2018

What did you do?

I executed a long-running query against a Redshift database. It's a COPY, so it doesn't return data.

What did you expect to happen?

Very little CPU utilisation, as the only interface elements changing are the spinner and counter in the status bar.

What actually happened?

~10% CPU utilisation on my 2017 MacBook Pro. I have attached a sample from Activity Monitor.

What software versions are you using?

Postico version: 1.4.2 (2845)

macOS version: 10.14.1 (18B75)

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.4896

@jakob

This comment has been minimized.

Owner

jakob commented Nov 13, 2018

Thanks for the sample! It looks like the culprit is the status display. It updates every 100ms, and apparently drawing that is a lot more expensive than I expected.

I've made two changes:

  1. I fixed a bug that caused the status display to redraw more often than needed
  2. After 10 seconds, the update frequency is reduced to 1 second (instead of 0.1 seconds)

In my testing, Postico now uses under 1% CPU for long running queries.

Can you try this build and let me know if it works for you?
https://eggerapps-downloads.s3.amazonaws.com/postico-3791.zip

@jdub

This comment has been minimized.

jdub commented Nov 13, 2018

@jakob Yes, always under 1%. And the 1 second update frequency is a bonus visual improvement. 👍🏻 Thank you! (… and now I'm not sitting on the fence about buying it.)

@jakob

This comment has been minimized.

Owner

jakob commented Nov 14, 2018

Thanks again for reporting this issue! We've merged the fix, and it will be in the next release of Postico. You can continue using build 3791 in the mean time!

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