The series continues today with our first actual C++ code! Today we’ll start with the absolute fundamentals—primitive types and literals—on which we’ll build through the rest of the series. As basic as this topic sounds, some of it can be pretty shocking when coming from a language like C#.
Posts Tagged float
Floating-point math is fast these days, but fixed-point still has a purpose: we can use it to store real numbers in less than 32 bits. Saving a measly 16 or 24 bits off a
float might not sound appealing, but cutting the data size in half or quarter often does when multiplied across large amounts of real numbers. We can shrink downloads, improve load times, save memory, and fit more into the CPU’s data caches. So today we’ll look at storing numbers in fixed-point formats and see how easy it can be to shrink our data!
Today we continue stealing
float bits, but in an entirely different way this time. We’ll end up with the ability to switch between
float and 21-bit integer modes and to know which mode we’re in. We can do all of this without using any more than four bytes just by exploiting a little knowledge of the
float data format. Read on to learn how!
With a bit of understanding and some C# trickery, we can exploit how
float works to cram in a few more bits and make some big performance gains. Today we’ll see how to steal some of the bits from a
Unity 2019.1’s new Burst job compiler has two options to increase performance even further:
FloatMode. By sacrificing some exactness in our calculations, we should be able to increase speed. Today’s article is about using those options and examining the results to verify the results.
There are a lot of ways to write C# code that has no effect. One common way is to initialize class fields to their default values:
public int Value = 0;. Today we’ll go over five types of useless code and see what effect it has on the actual machine code that the CPU executes. Do IL2CPP and the C++ compiler always do the right thing? Let’s find out!
The language’s built-in types should be trivial, but they’re not. There are a lot of little details overlooked by many programmers. Today’s article continues the series by looking at subtleties found in seemingly-obvious language features like strings and integers. Read on to learn some tricks!
In last week’s primer on the new domain memory (“Alchemy”) opcodes the initial test showed that they couldn’t match the performance of good old
Vector when writing out a lot of float/
Number values. Today’s article expands on that test to check the performance of writing integers and the performance of reading integers and float/
Number values. Can the domain memory opcodes redeem themselves? Read on to find out.
Since January, Adobe has dropped the “premium features” requirement for Flash apps that use the “domain memory opcodes” (a.k.a. “Alchemy opcodes”) that provide low-level performance-boosting operations that let you deal more-or-less directly with blocks of memory. Then in February we got Flash Player 11.6 along with built-in ASC 2.0 support for this feature. Today’s article shows you how to use these opcodes and takes a first stab at improving performance with them. Are they really all they’re cracked up to be?