Is Processing.js fast yet?

Standard

YES

One of my current projects I am working on is an educational game aimed at teaching the concepts of Mendelian Genetics to students.

What I’ve been working on for the last few days is optimizing the game for the web and iPad deployment.

My first shot at optimizations is making the game load up faster.

Comparing Processing.js to Native JAVA Processing on my PC I found the following results and they were surprising!

While the speed results for different pieces of code were different between browsers one thing was clear that the overall total time to complete running the setup() function was fastest in the browser in all cases except for IE9 and Safari on Windows 7. For individual test results only once was one piece of code faster in the JAVA environment compared to the browser.

Test System: Intel core i7, 12gb ram, Windows 7.

The green boxes show the fastest time for that section, when a time was within 1ms I have called it close enough to be a tie. I ran each test 5 times per browser and averaged the results to make sure there were no one offs.

Running the setup() loop to initialize the game

I’m sure I will be able to further optimize it in the next few days to be even faster this is just an initial observation. Now that I know whats slow I can work on some async loading or deferred loading. Or just better code.

Advertisements

2 thoughts on “Is Processing.js fast yet?

  1. wow, this is crazy. the takeaway message is that javascript is faster than java in the browser, for most browsers.

    i’d be curious to see some more comparisons for things that are in loop() instead, dealing with cpu-heavy and drawing-heavy operations.

  2. benq

    Starting the JVM takes quite a lot of time.

    I am not sure a <5 seconds program is really good t compare the performance of the libraries.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s