[Webkit-unassigned] [Bug 80476] [WebSocket] Add performance tests for data transmission

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 22 21:41:34 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=80476





--- Comment #12 from Ryosuke Niwa <rniwa at webkit.org>  2012-04-22 21:41:34 PST ---
(From update of attachment 130954)
View in context: https://bugs.webkit.org/attachment.cgi?id=130954&action=review

r- because of nits.

> Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py:237
> +            if relative_test_path.startswith('WebSocket'):
> +                if self._port._websocket_server is None:
> +                    self._port.start_websocket_server()
> +

My suggestion is to add a new PerfTest class like WebSocketPerfTest and then add some sort of prepare virtual method that gets called on every test.

> PerformanceTests/WebSocket/sendData.html:11
> +    var wsocket = new WebSocket("ws://localhost:8880/websocket/tests/hybi/echo");

Please don't use abbreviations like wsocket.

> PerformanceTests/WebSocket/sendData.html:15
> +    /*  
> +    *   if you run this page in web browser, please run command 
> +    *   "Tools/Scripts/run-webkit-websocketserver" to start websocket server.
> +    */ 

Could you put this in the body so that it's visible when you open it?
You can hide it (e.g. by display = 'none' or removing it from the document) when it's ran properly (i.e. when it's hosted on localhost).

> PerformanceTests/WebSocket/sendData.html:29
> +        PerfTestRunner.run(startFunc, 10, 5, completeFunc);
> +    };
> +
> +    function startFunc() {
> +        wsocket.send(data);
> +    }
> +
> +    function completeFunc() {
> +        wsocket.close();
> +    }

Since startFunc and completeFunc are only called by run, it's better to write it as:
PerfTestRunner.run(function () { wsocket.send(data); }, 10, 5, function () { wsocket.close(); });

By the way, could lower the number of function calls per iteration and increase the number of runs instead?
Taking just 5 samples isn't enough to compute min/max/stdev.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list