A code monkey randomly typing on a keyboard for an infinite amount of time will almost surely produce brilliance (almost).

Oh Em Gee, All of Those trace() Statements

Posted: November 6th, 2009 | Author: Huyen Tue Dao | Filed under: Development | Tags: , , , , | 2 Comments »

Alright, so I saw this insideria.com article by Tyler Larson about conditionally compiling for cleaner Actionscript when it came out and figured that it would be a good idea for peeling out some performance.  And Procrastee McProcrastinator (that’s me) didn’t get a chance to try any kind of pruning yet.

Then tonight as I’m tidying up some code for my side project I see this tweet by Ben Clinkinbeard noting that adding a trace statement increased a loop’s runtime by 1 second.  So following Larson’s article with a little help from flexexamples.com for setting up a flex-config.xml file, I set conditional compiling for every single trace statement and then compiled a new release build.

Wow.  Just wow.  We’re talking seconds shaved off loading batches of images.  And I’m frequently loading these small batches of images so the additional time was just piling up.

I feel incredibly duh-I-should-have-known-that-I-am-such-a-noob.

But hey, live and learn, right?  And I apologize to folks following me on Twitter for the spam and gratuitous face-palming. :)

Update: Dave Rosenfeld informed me via Twitter that trace actually initiates some disk I/O.  No wonder.


Dash: Actionscript code scripting in Eclipse

Posted: October 13th, 2009 | Author: Huyen Tue Dao | Filed under: Development | Tags: , , , , | No Comments »

Who was tired of writing out getters and setters constantly? *raise hand*

Who especially didn’t like do it while trying to override commitProperties() and thus had to write a monkey-buttload of xVariableChange booleans for when a property changed? *raise hand*

Who found a really great Eclipse plugin for generating getters/setters, static consts, and other I-really-don’t-want-type-or-even-copy-paste-these-keywords-anymore constructs? *raise hand*

Posted in 2007,  eokyere’s blog post on Dash (the Plugin Formerly Known as Eclipse Monkey) is a nice little intro to the plugin with a little example (showing how you can actually generate getters/setters with minimal work) and a little script (showing how to get Dash to generate getters/setters).

Short, sweet, easy-to-read.  The Dash update site was down supposedly for a while, but as of today, it’s back up and in business on my new copy of Eclipse Galileo (Cocoa, 64-bit).