Drastic Slow Down on calls to ofGetHeight() or ofGetWidth() in full screen?

This seems like an odd bug:

When in fullscreen mode, a for loop that uses ofGetWidth() and/or ofGetHeight() will slow my app to a crawl.

I’m using oF 0.9.3 on OSX 10.11

Here is the code I’m testing:

//--------------------------------------------------------------
void ofApp::draw(){

    for (int x = 0; x < ofGetWidth(); x += 20) {
        // do nothing
    }

    ofDrawBitmapString(ofToString(ofGetFrameRate()),10,10);
}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
    if (key == 'f') ofToggleFullscreen();
}

If I run the app in window mode, it runs at 60fps, but if I toggle to fullscreen, it slows to 13fps.

If I switch ofGetWidth() for a constant (i.e. 1920), I get 60fps in fullscreen.

Any ideas?

I should mention I’ve tested this on my Retina MacBook Pro display and on at 1080p external monitor with identical results.

Thanks

Sorry, just realized this post is a duplicate of this one from a few weeks ago:

Arturo’s solution is to store ofGetWidth() as a local variable, which is cool.

But I’ll leave this up since it seems like there is def a bug somewhere in calling ofGetWidth()/Height() in fullscreen.