jan 19

Recently i made a quick visual effect including the latest Flash Player 10 classes : Vector & Vector3D classes.

As the Vector and Vector3D classes are well optimized, I wanted to optimized my own loops.

So came again the question : "What is the most optimized loop system for these classes ?"

So i wrote a quick "while loops" performance test where i use a huge Vector array of Vector3D instances where i tried several systems.

I firstly thought that there was no way using the "for loops", but i read this quite interesting article :

http://www.experts-exchange.com/articles/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/ActionScript/20-Tips-to-Optimize-your-ActionScript.html

and i finally put the for loop test as the last test.

Each test performs a vector crossproduct on each Vector3D, and this for 2 millions vectors !!!

clear here to start the while-loop test

I was used to coding my loops with the first loop test :

i = vect.length;
while(i--){}

but apparently the most optimized loop on my mac (imac 27") should be the 3rd test :

i=vect.length;
while (--i>=0) {}

For my computer (Mac/Firefox) each test of the benchmark is almost the same, even the "for loop" which is quite efficient.

But I look closely, the fact is was using the less optimized while loop (according to this test)...

It's up to you to test your own computer and may choose one of these loop.

jan 13

As i was installing Alchemy toolkit for some experiment, i was first stuck in installing the Flex 3.5 SDK : to get the flex sdk linked to your system you are supposed to add the "flex/bin" directory in your system path.

Looking on the web, the ".profile" file has to be changed, but i couldn't find it... the reason : I had no ".profile" file on my system....

So if you don't have any ".profile" file in your home directory (your nickname directory), here are the steps to follow :

1) First of all, you may want to show hidden files on your mac to see exactly what you do,  to do so type the following lines in your terminal:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

  • change TRUE/FALSE to activate/deactivate the option
  • killall Finder will close all finders as it has to be restarted

2) Then create a new file in TextEdit for example and add this :

export PATH=$PATH:/usr/local/bin:/Applications/flex_sdk_3.5/bin

(in my example I unzipped the flex sdk in my Applications generic folder)

This will add the flex bin folder path in your system path.

3) Now save the file as ".profile" in your your home directory

4) Now you have to load/reload your ".profile" to make it active, type this in the terminal :

open a new Terminal so that it opens in your home directory and type:

. ./.profile

this will reload the file

5) test if your path has been integrated in the $Path variable, type

echo $PATH

6) Final step, check if Flex SDK is now available :

just type "adt" in your terminal and you should not have any error

That's it, if you want to check if your path