Posts Tagged inline

C++ For C# Developers: Part 35 – Modules, The New Build Model

Tags: , , , ,

We’ve already seen C++’s traditional build model based on #include. Today we’ll look at the all-new build model introduced in C++20. This is built on “modules” and is much more analogous to the C# build model. Read on to learn how to use it by itself and in combination with #include!

Read the rest of this article »

2 Comments

C++ For C# Developers: Part 17 – Namespaces

Tags: , , , ,

With structs wrapped up, we can move on to other features of C++. Today we’ll take a look at namespaces. We’ll cover the basics that C# provides, but go so much further and cover a lot of advanced functionality. Read on to learn all about them!

Read the rest of this article »

4 Comments

C++ For C# Developers: Part 5 – Build Model

Tags: , , ,

Today’s article continues the series by introducing C++’s build model, which is very different from C#. We’ll go into preprocessing, compiling, linking, header files, the one definition rule, and many other aspects of how our source code gets built into an executable.

Read the rest of this article »

10 Comments

Faster Functional Methods for Array and Vector

Tags: , , , , ,

Four years ago I tested the functional programming-style methods of Array and Vector: every, filter, forEach, map, and some. In that article I showed that these functions are much slower than doing the same task through traditional loops. Today’s article seeks to improve the performance of the functional methods while retaining readability by using ASC 2.0’s [Inline] metadata. Can homemade versions of these functions beat the built-in ones from Adobe? Read on to find out!

Read the rest of this article »

No Comments

Faster Log10

Tags: , , , ,

Today’s article is quick and to the point: when you need to take the base 10 logarithm of an integer you can speed this up by about 8x. Read on for the technique and save some CPU cycles!

Read the rest of this article »

11 Comments

Even Faster Trig Through Inlining

Tags: , , , , ,

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 article »

17 Comments

Fake Functions

Tags: , ,

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 article »

7 Comments

The Const Keyword

Tags: , , , , , ,

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 article »

12 Comments

Even Faster isNaN()

Tags: , , , ,

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 article »

9 Comments

Inline Math.ceil() Part II

Tags: , , , ,

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 article »

18 Comments