STLLoadertest three.js

JavaScript performance comparison

Revision 7 of this test case created by

Preparation code

<script src="https://rawgithub.com/mrdoob/three.js/master/build/three.min.js"></script>
<script src="https://rawgithub.com/mrdoob/three.js/389cf29b6bbbb43f0e6ab1e04a759ea999c1b30d/examples/js/loaders/STLLoader.js"></script>
<script>
  var old_version = THREE.STLLoader;
</script>
<script src="https://c9.io/gero3/threejs_stlloader/workspace/STLLoader3.js"></script>

<script>
  var latest_version = THREE.STLLoader;
</script>
<script src="https://rawgithub.com/mrdoob/three.js/master/examples/js/loaders/STLLoader.js"></script>
<script>
  var new_version = THREE.STLLoader;
</script>


<script>
    var url = "http://corsify.appspot.com/https://github.com/johannesboyne/node-stl/raw/b1608f640c5a703e223c9f03bd6202d252456cb2/test/test_data/RasPiCaseLight.stl"
    var ArraybufferVersion,StringVersion;
		var request1 = new XMLHttpRequest();

		request1.addEventListener( 'load', function ( event ) {
			ArraybufferVersion=  event.target.response;
		}, false );

		request1.open( 'GET', url, true );
		request1.responseType = "arraybuffer";
		request1.send( null );

	var xhr = new XMLHttpRequest();

	function onloaded( event ) {
		if ( event.target.status === 200 || event.target.status === 0 ) {
				StringVersion= event.target.responseText;
		}
	}

	xhr.addEventListener( 'load', onloaded, false );

	xhr.overrideMimeType('text/plain; charset=x-user-defined');
	xhr.open( 'GET', url, true );
	xhr.send( null );

</script>
    

Preparation code output

<script src="https://rawgithub.com/mrdoob/three.js/389cf29b6bbbb43f0e6ab1e04a759ea999c1b30d/examples/js/loaders/STLLoader.js"></script> <script> var old_version = THREE.STLLoader; </script> <script src="https://c9.io/gero3/threejs_stlloader/workspace/STLLoader3.js"></script> <script> var latest_version = THREE.STLLoader; </script> <script src="https://rawgithub.com/mrdoob/three.js/master/examples/js/loaders/STLLoader.js"></script> <script> var new_version = THREE.STLLoader; </script> <script> var url = "http://corsify.appspot.com/https://github.com/johannesboyne/node-stl/raw/b1608f640c5a703e223c9f03bd6202d252456cb2/test/test_data/RasPiCaseLight.stl" var ArraybufferVersion,StringVersion; var request1 = new XMLHttpRequest(); request1.addEventListener( 'load', function ( event ) { ArraybufferVersion= event.target.response; }, false ); request1.open( 'GET', url, true ); request1.responseType = "arraybuffer"; request1.send( null ); var xhr = new XMLHttpRequest(); function onloaded( event ) { if ( event.target.status === 200 || event.target.status === 0 ) { StringVersion= event.target.responseText; } } xhr.addEventListener( 'load', onloaded, false ); xhr.overrideMimeType('text/plain; charset=x-user-defined'); xhr.open( 'GET', url, true ); xhr.send( null ); </script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
old version
var test = new old_version()
test.parse(ArraybufferVersion)
pending…
new version
var test = new new_version()
test.parse(StringVersion)
pending…
latest version 1
var test = new latest_version()
test.parse(StringVersion)
pending…
latest version 2
var test = new latest_version()
test.parse(ArraybufferVersion)
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments