An Introduction to JS-Ctypes

Andrea Giammarchi andrea.giammarchi at gmail.com
Sat Sep 17 19:34:47 PDT 2011


Brendan I wrote I did it on purpose trying to predict what JS devs will do
once JS.next will bring ctypes like syntax.

I wrote the object with properties only assigned too indeed but as is for
functions expressions usually created everywhere by common developers rather
than reused where possible I bet devs will do the same if that will land in
JS.

I will file the bench at mozilla soon, thanks.

On Sat, Sep 17, 2011 at 8:43 PM, Brendan Eich <brendan at mozilla.com> wrote:

> On Sep 17, 2011, at 2:34 PM, Andrea Giammarchi wrote:
>
> > Also I have explicitly slowed down the logic creating a "classic" literal
> JS object per each loop iteration ... still, way too slow performances so
> whatever js-ctypes has been created for, something went wrong, imo
>
> Why are you doing that? I mean this, from your ctypes.perf.html:
>
>    for (var t = new Date, i = 0, length = npoints.length; i < length; i +=
> 2) {
>        window.lastPoint = {x: npoints[i], y: npoints[i + 1]};
>    }
>
> Don't make an object per loop iteration, instead assign to .x and .y
> separately.
>
> Anyway, the ctypes performance bug you're reporting does not predict binary
> data perf. Ctypes as a privileged FFI for SpiderMonkey, based on Python
> ctypes, was just brought up recently (in the life of SpiderMonkey). The JITs
> do not optimize for it as they do for typed arrays. Please file it at
> bugzilla.mozilla.org with your testcase. Thanks,
>
> /be
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110918/e43767bf/attachment.html>


More information about the es-discuss mailing list