Benchmarking Native Client and WebGL applications

415 views
Skip to first unread message

Fernando Carvalho

unread,
May 7, 2012, 6:10:47 AM5/7/12
to native-cli...@googlegroups.com
Hi NaCl Developers,

I would like to ask you if there is an easy way to automatically benchmark NaCl/WebGL and other HTML5 applications running on Google Chrome.
I know that there is the "--show-fps-counter" switch to show the frame rate of the running application, but I would like to know if there is a way to get that output on the console, so it could be integrated in a benchmark suit.
The aim here is to test every kind of Web applications against a selection of different hardware combinations test compatibility and performance.

--
Fernando

Fernando Carvalho

unread,
May 8, 2012, 11:11:23 AM5/8/12
to native-cli...@googlegroups.com
Hey,

Can someone help me on How to get frames rendered per second (FPS) information on console?
I wish to do some benchmarks on different hardware, but I'm unable to get that info.
In some older Chrome releases, there was a chart that appeared on the top of the window, when Chrome was started with "--show-fps-counter" but in current beta channel (19.0.1084.41 beta) it is not showing anymore.
Do someone knows anything about that?
--
Fernando

Alan Wolfe

unread,
May 8, 2012, 11:47:59 AM5/8/12
to native-cli...@googlegroups.com
printf goes to the console doesn't it?

seems like you just need to calculate fps and printf it every couple seconds to the console perhaps?

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.

Fernando Carvalho

unread,
May 8, 2012, 11:54:19 AM5/8/12
to native-cli...@googlegroups.com
No, it doesn't work, because I wish to run benchmarks without touching the source code of some applications that I don't have access to it's source.
Another issue, is about how it can be done on the Javascript side, when I'm benchmarking WebGL applications.
--
Fernando

Gregg Tavares (勤)

unread,
May 8, 2012, 12:36:52 PM5/8/12
to native-cli...@googlegroups.com
You could try Selenium

As for actually calculating FPS in WebGL. There's lots of examples of that on the net but basically

var then = Date.now() * 0.001;
function render() {
   var now = Data.now() * 0.001;
   var timeSinceLastFrame = now - then;
   then = now;
   ...
   //drawStuff
   ...
   requestAnimationFrame(render, canvas);
}

With the 0.001 there timeSinceLastFrame is in seconds. If you want to convert it to FPS then

fps = 1 / timeSinceLastFrame;


As for benchmarking apps without source you might look into extensions. For example the WebGL Inspector http://benvanik.github.com/WebGL-Inspector/ is probably a good place to start for WebGL apps.

Note: requestAnimationFrame requires a shim

David Michael

unread,
May 8, 2012, 1:15:46 PM5/8/12
to native-cli...@googlegroups.com
On Tue, May 8, 2012 at 10:36 AM, Gregg Tavares (勤) <gm...@google.com> wrote:
You could try Selenium

As for actually calculating FPS in WebGL. There's lots of examples of that on the net but basically

var then = Date.now() * 0.001;
function render() {
   var now = Data.now() * 0.001;
   var timeSinceLastFrame = now - then;
   then = now;
   ...
   //drawStuff
   ...
   requestAnimationFrame(render, canvas);
Note that this is capped at around 60 fps, so you won't be able to detect any difference for apps that could otherwise push 60 fps or better.

}

With the 0.001 there timeSinceLastFrame is in seconds. If you want to convert it to FPS then

fps = 1 / timeSinceLastFrame;


As for benchmarking apps without source you might look into extensions. For example the WebGL Inspector http://benvanik.github.com/WebGL-Inspector/ is probably a good place to start for WebGL apps.

Note: requestAnimationFrame requires a shim
If you're only testing against recent builds of Chrome, that might not be necessary.

Fernando Carvalho

unread,
May 8, 2012, 1:22:45 PM5/8/12
to native-cli...@googlegroups.com
Some time ago, I executed Google Chrome with "--show-fps-counter" flag, and it has shown a small chart on the top left with the frames per second that where being rendered.
However it isn't showing it anymore.
My initial idea was to get that value and output that to the terminal, but I'm unable to do this by this time. Can is there any way to do that?
I really want to do something very simple, I don't need a full framework. But keep in mind that I can't touch the source code of everything that I'm going to test.
Reply all
Reply to author
Forward
0 new messages