W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2009

[whatwg] Canvas pixel manipulation and performance

From: Mike Hearn <mike@plan99.net>
Date: Sun, 29 Nov 2009 19:58:36 +0100
Message-ID: <f4cd80640911291058w1de60a8s8fa2176db85964e5@mail.gmail.com>
> That's one way to get a healthy performance boost (typically)
> but where does the web developer stand in this work? ?Are
> you suggesting native code should replace JavaScript?

For code where performance is critical (like complex animation code) .... yes.

Don't get me wrong, I'm all for better JavaScript performance, but we
have to be realistic. Compared to native code JavaScripts performance
will always be lacking - many clever tricks have been deployed to
speed up JavaScript but even the fastest JS engines don't come close
to the output of average C++ compilers/JVMs. The nature of JS makes it
likely that this situation will remain true for a long time, perhaps
forever.

So there are two possibilities here - one is to introduce ever more
complexity into the web APIs for diminishing returns, even though a
primary goal of the web APIs is simplicity. And the other is to just
bind native code to those APIs, hopefully eliminating much of the
marshalling overhead along the way.

The latter approach has the advantage of not requiring novice-level
developers to understand things like endianness or bit masking to draw
some pixels (replace as appropriate for any given API), whilst
allowing developers that need it to get the fastest execution securely
possible.
Received on Sunday, 29 November 2009 10:58:36 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:19 UTC