Posts Tagged i/o

C++ For C# Developers: Part 50 – I/O Library

Tags: , , ,

We’ve seen a bit of I/O in the C Standard Library already, but this isn’t C++’s main way to perform I/O. Today we’ll look at the “streams” API that’s designed around C++’s support for strong types and overloaded operators rather than facilities like “format strings.” We’ll also see how to write the canonical “Hello, world!” program in C++ and how to finally implement DebugLog!

Read the rest of this article »

No Comments

C++ For C# Developers: Part 38 – C Standard Library

Tags: , , , ,

Today we’ll begin exploring the C++ Standard Library. As C++ is mostly a superset of C, the C++ Standard Library is mostly a superset of the C Standard Library. So we’ll begin there!

Read the rest of this article »

No Comments

C++ For C# Developers: Part 32 – Thread-Local Storage and Volatile

Tags: , ,

There is language-level support in C# for per-thread storage of variables. The same goes for the volatile keyword. C++ also supports per-thread variables, but with per-thread initialization and de-initialization. It has a volatile keyword too, but it’s meaning is quite different from C#. Read on to learn how to properly use these features in each language.

Read the rest of this article »

1 Comment

Can Fixed-Point Improve Performance?

Tags: , , , ,

Fixed-point types save memory compared to floating-point types, but can they also improve performance? Today’s article finds out!

Read the rest of this article »

3 Comments

Problem and Solution: The Terrible Inefficiency of FileStream and BinaryReader

Tags: , , , , ,

File I/O can be a major performance bottleneck for many apps. It’s all too easy to read files in a way that is massively inefficient. Classes like FileStream and BinaryReader make it really easy to write super slow code. Today’s article explores why this happens and what can be done about it. Read on to learn more!

Read the rest of this article »

34 Comments

File I/O Performance Tips

Tags: , , , , , ,

At some point, every project ends up reading or writing to the file system. If you do anything more than storing a single blob of bytes (e.g. JSON text) then you’ll need to be very careful about performance. It’s easy to accidentally write code that takes way longer to read and write than it should and you won’t get any help from the compiler or from Unity. Today’s article reveals some of these traps so you won’t fall into them!

Read the rest of this article »

13 Comments