Posts Tagged inline

Even Faster Trig Through Inlining

Last week’s article showed you a way to improve the performance of trig functions like Math.sin by almost 4x by using lookup tables. This week’s article will go even further and show you how to increase this speedup to over 10x!

Read the rest of this entry »

Tags: , , , , , , , , ,

10 Comments

Fake Functions

Today’s article is about a hack. It’s a hack dedicated to improving the performance of helper functions, nested or not. you may not like the way the code looks, but you’ll love the speed!

Read the rest of this entry »

Tags: , , , , ,

7 Comments

The Const Keyword

Amazingly, I’ve never covered the const keyword, but a couple of recent comments have prompted me to cover the subject in depth with today’s article.

Read the rest of this entry »

Tags: , , , , , ,

7 Comments

Even Faster isNaN()

I wrote an article last November showing how to make your isNaN() calls 12x faster. Today, thanks to a tip from the comments on that article, I’ll show you how to make your isNaN() calls even even faster! (UPDATE: see the definitive article on isNaN for much more!)

Read the rest of this entry »

Tags: , , , ,

9 Comments

Inline Math.ceil() Part II

I’ve been looking at a lot of AVM2 bytecode recently with the excellent Nemo440 AIR app. Some of the code was using my inline Math.ceil() function and I noticed that the int() cast is implemented like any other function call. Today’s article will show you how to optimize the inline Math.ceil() call even further by avoiding this function call.

Read the rest of this entry »

Tags: , , , , ,

17 Comments

Inlining Math Functions

As a followup to my article on Inlining Math.ceil(), I decided to inline some more functions in the Math class. Read on for the code as well as tests proving correctness and speed.

Read the rest of this entry »

Tags: , , , ,

3 Comments

Inline Math.ceil()

Math.ceil() is a common, mundane function that you likely call all the time. I know I do. If performance gets to be important and you have a Math.ceil() in some inner loop or frequently called function, consider inlining it. Below I’ll show you how and provide a test app showing you just how much CPU time you’ll save.

Read the rest of this entry »

Tags: , ,

10 Comments