Posts Tagged unsafe

IL2CPP Output for Unsafe Code

Tags: , , , ,

C# has some powerful features like fixed-size buffers, pointers, and unmanaged local variable arrays courtesy of stackalloc. These are deemed “unsafe” since they all deal with unmanaged memory. We should know what we’re ultimately instructing the CPU to execute when we use these features, so today we’ll take a look at the C++ output from IL2CPP and the assembly output from the C++ compiler to find out just that.

Read the rest of this article »

6 Comments

JSON Is Incredibly Bloated

Tags: , , ,

In previous articles I’ve compared the performance of various JSON libraries. Unity’s built-in JsonUtility usually comes out on top, but that conclusion loses sight of the bigger picture. JsonUtility is only really fast when you compare it to other JSON libraries. Compared to non-JSON alternatives, it’s ludicrously slow and oversized. Today’s article compares JSON to an alternative format to highlight just how bloated JSON is.

Read the rest of this article »

10 Comments

Optimizing Arrays and Lists

Tags: , , , ,

Last week’s article compared the performance of arrays with List<T> and found List lacking. This week we’ll optimize both List and array to maximize performance regardless of which you choose to use.

Read the rest of this article »

6 Comments

From AS3 to C#, Part 21: Unsafe Code

Tags: , , , ,

The series is nearing an end! In today’s article we’ll cover so-called “unsafe” code that gives you unprecedented access to system memory. You can use this to optimize your app or integrate with native (e.g. C, C++) code and APIs. Read on to learn more about this powerful C# tool!

Read the rest of this article »

4 Comments