# Usefull but unsexy class

**URL:** <https://forum.kirupa.com/t/usefull-but-unsexy-class/264633>\
**Category:** Uncategorized\
**Created:** [June 27, 2008, 10:29pm UTC](https://forum.kirupa.com/t/usefull-but-unsexy-class/264633 "2008-06-27T22:29:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dom\_1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dom\_1](https://forum.kirupa.com/u/Dom_1)\
**Post date:** [June 27, 2008, 10:29pm UTC](https://forum.kirupa.com/t/usefull-but-unsexy-class/264633/1 "2008-06-27T22:29:01Z")

</div>

this is probably the most unsexy “source/experiments” post, but I thought I would share anyway.  
A few [speed optimizations](http://www.signalsondisplay.com/blog/?p=12) for action script 3.0  
If anyone else knows any other optimization tricks, share them 🙂

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [June 27, 2008, 11:59pm UTC](https://forum.kirupa.com/t/usefull-but-unsexy-class/264633/2 "2008-06-27T23:59:00Z")

</div>

There’s a couple of good ones out there… to use instead of “/” and Math.round.floor.ceil and all that slowness.

The most drastic one I’ve seen so far is to use int(number) instead of Math.floor(number)

Like 2000 times faster, but gets wonky with negative values 😉

---

<div class="post-metadata">

**Author:** ![Sirisian](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Sirisian](https://forum.kirupa.com/u/Sirisian)\
**Post date:** [June 28, 2008, 12:06am UTC](https://forum.kirupa.com/t/usefull-but-unsexy-class/264633/3 "2008-06-28T00:06:57Z")

</div>

Speaking of the power function one I use from time to time if needed is the power of 2 trick. (0x1 \<\< exponent) Bitwise operations are very quick.

---

<div class="post-metadata">

**Author:** ![Dom\_1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dom\_1](https://forum.kirupa.com/u/Dom_1)\
**Post date:** [June 28, 2008, 11:18am UTC](https://forum.kirupa.com/t/usefull-but-unsexy-class/264633/4 "2008-06-28T11:18:23Z")

</div>

yeah theres a bunch of good ones over at [osflash.org](http://osflash.org).  
And I think that using (number) \>\> 0 instead of int(number) might even be faster… would need to compare both of them
