Permalink
Browse files

Tweaked dist/ build for better Chrome performance.

  • Loading branch information...
1 parent 4e144b8 commit 03911910e1b4f39cea2821796632a800aae0e6af @max99x max99x committed Sep 2, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 dist/python.opt.js
View
@@ -11,7 +11,7 @@ function setValue(g,e,b){b[b.length-1]==="*"&&(b="i32");switch(b){case "i1":HEAP
function getValue(g,e){e[e.length-1]==="*"&&(e="i32");switch(e){case "i1":return HEAP[g];case "i8":return HEAP[g];case "i16":return HEAP[g];case "i32":return HEAP[g];case "i64":return HEAP[g];case "float":return HEAP[g];case "double":return HEAP[g];default:abort("invalid type for setValue: "+e)}return null}this.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2;
function allocate(g,e,b){var a,c;typeof g==="number"?(a=!0,c=g):(a=!1,c=g.length);for(var b=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc][b===void 0?ALLOC_STATIC:b](Math.max(c,1)),d=typeof e==="string"?e:null,f=0,h;f<c;){var j=a?0:g[f];typeof j==="function"&&(j=Runtime.getFunctionIndex(j));h=d||e[f];h===0?f++:(setValue(b+f,j,h),f+=Runtime.getNativeTypeSize(h))}return b}Module.allocate=allocate;
function Pointer_stringify(g){for(var e="",b=0,a,c=String.fromCharCode(0);;){a=String.fromCharCode(HEAP[g+b]);if(a==c)break;e+=a;b+=1}return e}Module.Pointer_stringify=Pointer_stringify;function Array_stringify(g){for(var e="",b=0;b<g.length;b++)e+=String.fromCharCode(g[b]);return e}Module.Array_stringify=Array_stringify;var PAGE_SIZE=4096;function alignMemoryPage(g){return Math.ceil(g/PAGE_SIZE)*PAGE_SIZE}
-var HEAP,STACK_ROOT,STACKTOP,STACK_MAX,STATICTOP,HAS_TYPED_ARRAYS=!1,TOTAL_MEMORY=52428800,FAST_MEMORY=TOTAL_MEMORY/32;HEAP=Array(FAST_MEMORY);for(var i=0;i<FAST_MEMORY;i++)HEAP[i]=0;for(var base=intArrayFromString("(null)"),i=0;i<base.length;i++)HEAP[i]=base[i];Module.HEAP=HEAP;STACK_ROOT=STACKTOP=alignMemoryPage(10);var TOTAL_STACK=1048576;STACK_MAX=STACK_ROOT+TOTAL_STACK;STATICTOP=alignMemoryPage(STACK_MAX);
+var HEAP,STACK_ROOT,STACKTOP,STACK_MAX,STATICTOP,HAS_TYPED_ARRAYS=!1,TOTAL_MEMORY=52428800,FAST_MEMORY=Math.floor(TOTAL_MEMORY/22);HEAP=Array(FAST_MEMORY);for(var i=0;i<FAST_MEMORY;i++)HEAP[i]=0;for(var base=intArrayFromString("(null)"),i=0;i<base.length;i++)HEAP[i]=base[i];Module.HEAP=HEAP;STACK_ROOT=STACKTOP=alignMemoryPage(10);var TOTAL_STACK=1048576;STACK_MAX=STACK_ROOT+TOTAL_STACK;STATICTOP=alignMemoryPage(STACK_MAX);
function __shutdownRuntime__(){for(;__ATEXIT__.length>0;){var g=__ATEXIT__.pop(),e=g.func;typeof e==="number"&&(e=FUNCTION_TABLE[e]);e(g.arg===void 0?null:g.arg)}CorrectionsMonitor.print()}function Array_copy(g,e){return HEAP.slice(g,g+e)}Module.Array_copy=Array_copy;function String_len(g){for(var e=0;HEAP[g+e];)e++;return e}Module.String_len=String_len;function String_copy(g,e){var b=String_len(g);e&&b++;var a=Array_copy(g,b);e&&(a[b-1]=0);return a}Module.String_copy=String_copy;
if(typeof print==="undefined")this.print=console.log;function intArrayFromString(g,e){for(var b=[],a=0;a<g.length;){var c=g.charCodeAt(a);c>255&&(c&=255);b.push(c);a+=1}e||b.push(0);return b}Module.intArrayFromString=intArrayFromString;function intArrayToString(g){for(var e=[],b=0;b<g.length;b++){var a=g[b];a>255&&(a&=255);e.push(String.fromCharCode(a))}return e.join("")}Module.intArrayToString=intArrayToString;function unSign(g,e){return g>=0?g:e<=32?2*Math.abs(1<<e-1)+g:Math.pow(2,e)+g}
function reSign(g,e){if(g<=0)return g;var b=e<=32?Math.abs(1<<e-1):Math.pow(2,e-1);g>=b&&(g=-2*b+g);return g}
@@ -11498,4 +11498,4 @@ this.Python={initialize:function(g,e,b){this.isInitialized?console.log("Ignoring
_PyModule_GetDict(this.module),this.isInitialized=!0,this.eval('def help(x):\n print getattr(x, "__doc__", "No documentation.")\n print ""\n print "For detailed help, run \'from pydoc import help\' (slow)."'))},eval:function(g){if(!this.isInitialized)throw Error("Python runtime not initialized.");var g=this.allocateString(g),e=_Py_CompileStringFlags(g,this.filename,this.Py_eval_input,this.flags);e===0&&(_PyErr_Clear(),e=_Py_CompileStringFlags(g,this.filename,this.Py_file_input,this.flags));if(e===
0)_PyErr_Print(),_free(g);else{var b=_PyEval_EvalCode(e,this.globals,this.globals);if(b===0)_PyErr_Print(),_Py_DecRef(e),_free(g);else{var a=Pointer_stringify(_PyString_AsString(_PyObject_Repr(b)));a==="None"&&(a=null);_Py_DecRef(e);_Py_DecRef(b);_free(g);return a}}},isFinished:function(g){if(!this.isInitialized)throw Error("Python runtime not initialized.");var g=this.allocateString(g),e=_Py_CompileStringFlags(g,this.filename,this.Py_eval_input,this.flags);e===0&&(_PyErr_Clear(),e=_Py_CompileStringFlags(g,
this.filename,this.Py_file_input,this.flags));if(e!==0)return _free(g),!0;var e=allocate([0],"void*",ALLOC_NORMAL),b=allocate([0],"void*",ALLOC_NORMAL),a=allocate([0],"void*",ALLOC_NORMAL),c=allocate([0],"void*",ALLOC_NORMAL),d=allocate([0],"i8*",ALLOC_NORMAL),f=this.allocateString("sO");_PyErr_Fetch(e,b,a);var h=allocate([d,0,0,0,c,0,0,0],["i8**",0,0,0,"void*",0,0,0],ALLOC_NORMAL);_PyArg_ParseTuple(getValue(b,"void*"),f,h);var j=Pointer_stringify(getValue(d,"i8*")),j=j!="unexpected EOF while parsing"&&
-j!="EOF while scanning triple-quoted string literal";_Py_DecRef(e);_Py_DecRef(b);_Py_DecRef(a);_free(h);_free(g);_free(f);_free(d);_free(c);_free(a);_free(b);_free(e);return j},isInitialized:!1,flags:null,filename:null,module:null,Py_single_input:256,Py_file_input:257,Py_eval_input:258,allocateString:function(g){return allocate(intArrayFromString(g),"i8",ALLOC_NORMAL)}};
+j!="EOF while scanning triple-quoted string literal";_Py_DecRef(e);_Py_DecRef(b);_Py_DecRef(a);_free(h);_free(g);_free(f);_free(d);_free(c);_free(a);_free(b);_free(e);return j},isInitialized:!1,flags:null,filename:null,module:null,Py_single_input:256,Py_file_input:257,Py_eval_input:258,allocateString:function(g){return allocate(intArrayFromString(g),"i8",ALLOC_NORMAL)}};

0 comments on commit 0391191

Please sign in to comment.