Large web page performance?

Hello,

I was just wondering if my app performance seems ok :

i made an very simple app grabbing a web page (quite large ! 5200 x 1000 pixels) and publishing it through a syphon server.

I use ofxAwesomium and ofxSyphon addons

I experience a 20 to 40 fps and about 70 % CPU load on a macmini i7 quad core 2,3 GHz under Yosemite

I find it a bit heavy. Is that normal ?

here is the code :

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
    ofSetFrameRate(60);
    
    syphonServer.setName("oF Web Page");
    
    browser.setup(5200, 1000);
    urlAddress = "http://url.here";
    browser.loadURL(urlAddress);
}

//--------------------------------------------------------------
void ofApp::update(){
    browser.updateCore();
    browser.update();
}

//--------------------------------------------------------------
void ofApp::draw(){
    browser.draw(0, 0);
    ofSetColor(ofColor::black);
    ofBackground(220);
    
    string flux = "Size : " + ofToString(browser.getWidth()) + " x " + ofToString(browser.getHeight()) + " pixels";
    ofDrawBitmapString(flux, 20, 70);
    
    string urlText = "URL : " + urlAddress;
    ofDrawBitmapString(urlText, 20, 100);

    string fpsStr = "Performances : " + ofToString(ofGetFrameRate(), 2) + " fps";
    ofDrawBitmapString(fpsStr, 20, 130);
    
      syphonServer.publishTexture(&browser.frame.getTextureReference());
}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
    if (key == 'n'){
    urlAddress = ofSystemTextBoxDialog("enter URL", urlAddress);
    browser.loadURL(urlAddress);
    }
    if (key == 'r'){
        browser.loadURL(urlAddress);
    }
}

Full code is available here : https://github.com/martialgallorini/ofWebSyphon

thanks a lot

1 Like