tag:blogger.com,1999:blog-5248616490907735528.post7117217516455429975..comments2023-03-20T05:36:55.114-07:00Comments on Scriptensity: Python Demokripkenhttp://www.blogger.com/profile/06468064783634443137noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-5248616490907735528.post-80449339738745643072010-12-19T12:58:22.424-08:002010-12-19T12:58:22.424-08:00@Daniel: Good catch, thanks!@Daniel: Good catch, thanks!kripkenhttps://www.blogger.com/profile/06468064783634443137noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-664569298500743112010-12-19T02:37:46.647-08:002010-12-19T02:37:46.647-08:00But I have undefineds in the heap (just type i[8] ...But I have undefineds in the heap (just type i[8] in the and I have Chrome version 10.0.615.0 (69640), so it must have typed arrays.<br />Just enter i[8] etc. and you see there are many undefined elements. Undefined makes the slice slow. And the mentioned code makes it fast again. So it must be an unitialized Array.<br /><br /><br /><br />I found it: if(aaa=this.Int32Array&&this.Float64Array) {}<br /><br />Chrome doesn't support Float64Array yet, so it becomes a normal array with lots of undefineds. Initializing them with 0 makes it fast again.PPhttps://www.blogger.com/profile/17217641300920675101noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-58997191886238544692010-12-18T13:21:46.571-08:002010-12-18T13:21:46.571-08:00@Daniel:
Chrome initializes typed array values to...@Daniel:<br /><br />Chrome initializes typed array values to 0 (unless there is a serious bug there). However older Chrome versions don't have typed arrays enabled by default (needs --enable-typed-arrays), so they would have normal JS stuff, with lots of undefineds in HEAP as you mentioned.<br /><br />However this is slow even with typed arrays, and the code in the bug I filed is slow with or without typed arrays (when comparing to SpiderMonkey).<br /><br />So I don't really know why Chrome is slow on this code...kripkenhttps://www.blogger.com/profile/06468064783634443137noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-79158268770821933012010-12-18T11:14:10.230-08:002010-12-18T11:14:10.230-08:00hm
it isn't true. As i create an Int32Array it...hm<br />it isn't true. As i create an Int32Array it becomes an 0.<br />The problem lies in ka.PPhttps://www.blogger.com/profile/17217641300920675101noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-71342246012401782722010-12-18T10:37:42.882-08:002010-12-18T10:37:42.882-08:00for(var a = 0; a < i.length; a++) {if(i[a]==und...for(var a = 0; a < i.length; a++) {if(i[a]==undefined) i[a]=0} of course, but that took long and got an error while it was busy.PPhttps://www.blogger.com/profile/17217641300920675101noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-73967535775103789442010-12-18T10:33:44.793-08:002010-12-18T10:33:44.793-08:00this makes it faster for now:
for(var a = 0; a <...this makes it faster for now:<br />for(var a = 0; a < 1000000; a++) {if(i[a]==undefined) i[a]=0}PPhttps://www.blogger.com/profile/17217641300920675101noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-23119536659028101602010-12-18T10:26:36.917-08:002010-12-18T10:26:36.917-08:00Int32Array doesn't initialize them, however, v...Int32Array doesn't initialize them, however, v8 should do that as is said here: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html<br />filed a bug: http://code.google.com/p/v8/issues/detail?id=1001&q=array&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Area%20StarsPPhttps://www.blogger.com/profile/17217641300920675101noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-7942815618469836852010-12-18T10:11:44.214-08:002010-12-18T10:11:44.214-08:00I think the difference in v8 is in this:
the globa...I think the difference in v8 is in this:<br />the global array i in python.js has many elements 'undefined' in Chrome, but these are 0 in Firefox. Them being undefined makes slice a lot slower.<br />Seems like Firefox initalizes them and v8 not?PPhttps://www.blogger.com/profile/17217641300920675101noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-45490303817873436112010-12-13T20:40:43.834-08:002010-12-13T20:40:43.834-08:00Thanks puffnfresh! It is fixed now.Thanks puffnfresh! It is fixed now.kripkenhttps://www.blogger.com/profile/06468064783634443137noreply@blogger.comtag:blogger.com,1999:blog-5248616490907735528.post-48274844301145807582010-12-13T00:34:40.934-08:002010-12-13T00:34:40.934-08:00Awesome work guys!
I'm getting "Referenc...Awesome work guys!<br /><br />I'm getting "ReferenceError: _llvm_memmove_p0i8_p0i8_i32 is not defined." for the following:<br /><br /> print [dir(x) for x in dir()]Brian McKennahttps://www.blogger.com/profile/10725680599856600394noreply@blogger.com