openframeworks / openframeworks/openFrameworks

Calling ofGetScreenWidth() causes massive slow down on Ubuntu

Open
#5,724 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

Hi, I found out calling ofGetScreenWidth() or ofGetScreenHeight() causes frame rate to drop to 2~3 fps on Ubuntu.

9ea561b99fb9eccec80100e63935cb9d57cff202

You can test this by simply adding this code inside update()

 ofGetScreenWidth();
cout << "frameRate : " << ofGetFrameRate() << endl;

I use OF_0.9.8_release and I found a relevant commit here. https://github.com/openframeworks/openFrameworks/pull/5028

But the problem still occurred even after applying the fix.
Calling ofGetWidth() or ofGetHeight() didn't slow down the app though.

I would appreciate if any Linux user can confirm this.
Thanks in advance!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the slowdown in update() with ofGetScreenWidth() or ofGetScreenHeight(), comparing it with ofGetWidth() and ofGetHeight() on Ubuntu. Review the linked pull request 5028 and trace the implementations of these screen-size entry points. Done means the screen-size calls no longer reduce the frame rate to 2–3 fps.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux, ubuntu
Domain
operating-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.