Index: tests/srpc/srpc_perf_ppapi.html |
=================================================================== |
--- tests/srpc/srpc_perf_ppapi.html (revision 4284) |
+++ tests/srpc/srpc_perf_ppapi.html (working copy) |
@@ -1,145 +0,0 @@ |
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
-<html> |
- <!-- Copyright 2008 Google Inc. All rights reserved. --> |
- <head> |
- <title> Simple RPC Performance Tests </title> |
- <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
- <META HTTP-EQUIV="Expires" CONTENT="-1"> |
- <script type="application/x-javascript"> |
- //<![CDATA[ |
-var ClearCanvas = function() { |
- this.context.fillStyle = 'rgb(0,0,0)'; |
- this.context.fillRect(0, 0, this.xsize, this.ysize); |
- this.output.textContent = this.type; |
-} |
- |
-var BenchSteps = 50000; |
-var RunBenchmark = function() { |
- var context = this.context; |
- var steps = BenchSteps; |
- var point_function = this.point_function; |
- var output = document.getElementById('LogOutput'); // this.output; |
- var call_time = 0; |
- var worst_time = 0; |
- for (var i = 0; i < steps; i++) { |
- var before_call = new Date(); |
- var arr = point_function(); |
- var after_call = new Date(); |
- var difftime = after_call.getTime() - before_call.getTime(); |
- call_time = call_time + difftime; |
- if (difftime > worst_time) { |
- worst_time = difftime |
- } |
- } |
- output.innerHTML += |
- this.type + ': ' + call_time + ' ms (' + (call_time / steps) + |
- ' per call; worst ' + worst_time + ')<BR>\n'; |
-} |
- |
-var Benchmark = function(type, point_function) { |
- this.type = type; |
- this.point_function = point_function; |
- this.output = document.getElementById(type + 'Output'); |
- this.Run = RunBenchmark; |
-} |
- |
-var BenchIntTest; |
-var BenchStringTest; |
-var BenchBigStringTest; |
-var BenchNullTest; |
-var BenchNullNpapiTest; |
-var BenchRPC3x; |
-var OneKString = |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + |
- "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"; |
- |
-// Init is called when the document has completed loading. It downloads the |
-// NativeClient module and sets up the two benchmark run methods. |
-var Init = function(boxsize) { |
- var log = document.getElementById('LogOutput'); |
- // Remember the element for the Native Client service. |
- native_client_service = document.getElementById('nacl'); |
- // Set a banner in the log. |
- log.innerHTML += "Using " + BenchSteps + " iterations for each test<BR>\n"; |
- // Create a NativeClient version of the benchmark. |
- var IntTestNativeClient = function() { |
- return native_client_service.int(0); |
- } |
- BenchIntTest = new Benchmark('IntTest', IntTestNativeClient); |
- var StringTestNativeClient = function() { |
- return native_client_service.string("hello world"); |
- } |
- BenchStringTest = new Benchmark('StringTest', StringTestNativeClient); |
- var BigStringTestNativeClient = function() { |
- return native_client_service.string(OneKString); |
- } |
- BenchBigStringTest = |
- new Benchmark('BigStringTest', BigStringTestNativeClient); |
- var NullRpcTestNativeClient = function() { |
- return native_client_service.string(OneKString); |
- } |
- BenchNullTest = new Benchmark('NullRpcTest', NullRpcTestNativeClient); |
- var NullNpapiTestNativeClient = function() { |
- return native_client_service.__nullPluginMethod(OneKString); |
- } |
- BenchNullNpapiTest = |
- new Benchmark('NullNpapiTest', NullNpapiTestNativeClient); |
-} |
- //]]> |
- </script> |
- </head> |
- <body onload="Init();"> |
- <h1> Native Client Simple RPC Performance Tests </h1> |
- <table summary="A collection of buttons to invoke tests"> |
- <thead> |
- <tr> |
- <td align=center> |
- <input type="button" onclick="BenchIntTest.Run()" |
- value="IntTest" /> |
- </td> |
- <td align=center> |
- <input type="button" onclick="BenchStringTest.Run()" |
- value="StringTest" /> |
- </td> |
- <td align=center> |
- <input type="button" onclick="BenchBigStringTest.Run()" |
- value="BigStringTest"> |
- </input> |
- </td> |
- <td align=center> |
- <input type="button" onclick="BenchNullTest.Run()" |
- value="NullRpcTest" /> |
- </td> |
- <td align=center> |
- <input type="button" onclick="BenchNullNpapiTest.Run()" |
- value="NullNpapiTest" /> |
- </td> |
- </thead> |
- </table> |
- <h2> |
- Click any button above to run a benchmark. |
- </h2> |
- <embed type="application/x-ppapi-nacl-srpc" id="nacl" height="0" width="0" |
- src="srpc_test.nexe" /> |
- <table summary="A box containing execution logging output"> |
- <tr> |
- <td id="LogOutput" /> |
- </tr> |
- </table> |
- </body> |
-</html> |