Latest Uploads
Extraterre ... .0.1 (zip)

dantheman363

Monty Teas ... Screenie 1

steve_ancell

Santa Clau ... ed his bag

waroffice

manic_platdude.png

spinal

Tetris Clone

steve_ancell

Super blues bros.

spinal

Back to JL235's Blog ( Created 08 March 2011 | Last Edited 08 March 2011)
Development Diary : PlayMyCode updates!
Today I have three new updates out for PlayMyCode, YAY!

First a new forum so you can ask for help and discuss other stuff too.

Second a new blog so you can read about PlayMyCode and new PMC stuff in the pipeline (first post is being written as I type).

Finally everything is much faster! Compilation is about 4 times faster and games run much smoother. Space Snake Galaxies is finally playable in a smooth state on my machine in FireFox!

It's great that the site is really starting to come along. Core features are finally falling into place, like we've started on the users page too. But we have great ideas on how to improve it further in the future. So I invite you all to go check out PlayMyCode (again) and enjoy it!

Latest Comments

Posted : Tuesday, 08 March 2011, 15:29
Jayenkai


Hurray!! Finally a blog that I can nick content from, each Friday

Posted : Tuesday, 08 March 2011, 15:35
HoboBen


Wow, I am impressed with how well its working on Firefox now. Was there anything special you did to do that, or was it just a case of optimising what you had already?

Posted : Tuesday, 08 March 2011, 16:07
JL235


The games are now embedded within an iFrame on PMC. This means that FireFox doesn't render the rest of the page underneath underneath the canvas such as box-shadows or gradients (which is was doing).

Secondly I profiled the compilation process and found two main issues. First I was using concat as a clean way to join two arrays together because it's very elegant to do so. However it's _much_ cheaper to iterate over an array and manually push each element onto the other. Turns out you should only use concat if you actually need a new copy of the array, which I didn't.

The second thing that was taking a lot of time was 'Array.prototype.slice(arguments)' which is the way suggested online to turn an 'arguments' object into an Array object (for those who don't know the arguments object is a fake array that contains all of the parameters passed into a function, but the trouble is that it's not actually a real array).

Using slice is fast for copying large arrays however it's very rare that you have more then 10 parameters passed into a function. With very small arrays (less then 10 items) it's much faster to just make a new array and push each element onto it.

Finally when you run JS the page will freeze until the JS has finished running. This is because no event's can run, because they can trigger more JS (which the running JS is blocking). This also blocks things like gif animations and JQuery fades. The solution is to use 'setTimeout' to run your code as multiple functions seperated by a couple of milliseconds.

The Quby compiler now uses a special library (called util.future) which I wrote for running multiple functions automatically with setTimeout (it's only about 100 lines). I also changed the front-end of the compiler (only another 100 lines) so it now breaks up the high level parts into seperate function calls, each seperated by 10 milliseconds of breathing space.

In short this means the Quby compiler locks the browser up for much shorter periods of time, allowing the browser to smoothly fade into the compilation process and then fade out.

Posted : Wednesday, 09 March 2011, 03:51
Jayenkai


Your blog is void and empty. ^ Post that to your blog!

Posted : Wednesday, 09 March 2011, 05:04
JL235


My brother was supposed to write the first blog post last Sunday. If he doesn't get it done within a few hours I'll post that as our first.

Otherwise I'll write that up and post it laterz in the week.

Posted : Wednesday, 09 March 2011, 07:53
JL235


First post is done! Expect a detailed JS game optimization post in a few days.

Posted : Wednesday, 09 March 2011, 08:15
Jayenkai


woot!

Latest Posts
RoadRash!
spinal Sun 09:53
Noel's Graduation
spinal Sun 09:49
Screen Burn of the Mind
rockford Sun 09:01
Audio Rant
steve_ancell Sat 19:16
Wrong Partition!!!!?
spinal Sat 11:24
Progress / Location Bars
Afr0 Sat 03:15
eBay Lies
spinal Fri 23:44
Shoutbox Topic - 968
dna Fri 19:42
Development via GUI
JL235 Fri 07:59
Meh
Afr0 Fri 04:13
More

Latest Items
News : Newsletter #176
Jayenkai Sat 04:49
News : Newsletter #175
Dabz Tue 09:38
Blog : Snow: More Material Junk
Cower Sat 23:17
Dev-Diary : Mutant Monty: Amstrad CPC to Windows conversion
rockford Fri 13:14
Techy : AppleTV
Jayenkai Thu 09:40
Blog : Graphviz
steve_ancell Sat 14:17
Pets : Top-Down Shadow Hack
Jayenkai Tue 05:52
Snippet : JNKrunch v1.0
Jayenkai Sat 07:20
News : Newsletter #173
waroffice Fri 04:47
Blog : Material Loading
Cower Fri 02:08
Pets : I Done Won A Thing
shroom_monk Sun 11:31
Pets : Repurposing A Lexer
Cower Mon 22:06
Bah : Feeling a Little Angry
spinal Mon 11:26
News : Newsletter #170
Dabz Sat 00:34
Showcase : sbfgen
Cower Sat 16:57
More

Who's Online
Cower
Sun, at 10:01
spinal
Sun, at 10:00
rockford
Sun, at 09:38
Jayenkai
Sun, at 09:36
9572AD
Sun, at 08:32
CodersRule
Sun, at 08:29
Evil Roy Ferguson
Sun, at 08:13
steve_ancell
Sun, at 08:04
Afr0
Sun, at 07:52
shroom_monk
Sun, at 06:28
Link to this page
Site : Jayenkai 2006-Infinity |
MudChat's origins, BBCode's former life, Image Scaler.