This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cache from global scope | |
var _parseInt = this.parseInt; | |
_speedTest( | |
[ | |
function(n) | |
{ | |
var r, g, b, s = '#aabbcc'; | |
var i = n; while(i--) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _abs = Math.abs; | |
_speedTest( | |
[ | |
function(n) | |
{ | |
var a = 0; | |
var i = n; while(i--) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _abs = Math.abs; | |
var _floor = Math.floor; | |
var _rand = Math.random; | |
_speedTest( | |
[ | |
function(n) | |
{ | |
var i = n; while(i--) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$jb.Loader._scope(). | |
_require('$jb/$G.Function.js'). | |
_require('$jb/OOP.js'). | |
_require('http.node'). | |
_require('$jb/exceptions.js'). | |
_require('$jb/$jb.Url.js'). | |
_require('$jb/$jb.Net.Base.js'). | |
_willDeclared('$jb/$jb.Net.HTTPClient.js'). | |
_completed(function($G, $jb){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($G) | |
{ | |
var cache = {}; | |
var XHR = $G.XMLHttpRequest || function(){ return new $G.ActiveXObject('Microsoft.XMLHTTP') }; | |
$G.require = function(url) | |
{ | |
if(!(url in cache)) | |
{ | |
var xhr = new XHR(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
@hint | |
@see https://wiki.mozilla.org/Audio_Data_API | |
@see http://www.opensource.apple.com/source/WebCore/WebCore-737.5/html/canvas/ | |
@see https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html | |
Array.U32 = $G.Uint32Array || $G.WebGLUnsignedIntArray || $G.CanvasUnsignedIntArray || Array; | |
Array.U16 = $G.Uint16Array || $G.WebGLUnsignedShortArray || $G.CanvasUnsignedShortArray || Array; | |
Array.U8 = $G.Uint8Array || $G.WebGLUnsignedByteArray || $G.CanvasUnsignedByteArray || Array; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Basic idea - measure cost of simplest operation of js in cpu cycles | |
asm | |
//var i = n; | |
mov EAX, n | |
// while(i--); | |
a: dec EAX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Goal of this test is find best data structure for store matrices, vectors and quaternions | |
In C/C++ we have ability to store same data different ways ie | |
union | |
{ | |
float m[9]; | |
struct | |
{ | |
float | |
m00, m01, m02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Traditionally in js we separate arrays and hashes(maps, Object, dictionary, ...) | |
Test shows that modern engines havent array optimization - it just hash with automatic <.length> property and sugar array like methods :( | |
*/ | |
var m = 1000; | |
var _fill = function(a) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
(function() | |
{ | |
var _warmUp = function() | |
{ | |
var d = Date.now(); | |
while(Date.now() - d < 4000) | |
{ |