Posts Tagged linkedlist

C++ For C# Developers: Part 46 – Other Containers Library

Tags: , , ,

Array-like containers aren’t the only containers we need. Today we’ll look at the non-array containers the C++ Standard Library provides, including its equivalents of Dictionary, HashSet, and LinkedList.

Read the rest of this article »

No Comments

C++ For C# Developers: Part 45 – Array Containers Library

Tags: , , , ,

We use certain container types, like maps and dynamic arrays, constantly. Others, like linked lists and queues, more sparingly. Still, they are fundamental structures in virtually every program and the poster children for generic programming. Like C#, the Standard Library in C++ provides a bunch of container types. Today we’ll start going through them, starting with containers for various kinds of arrays!

Read the rest of this article »

No Comments

NativeLinkedList<T>: Part 3

Tags: , ,

Last time in the series we encountered and overcame a host of esoteric issues on our path to a better understanding of Unity’s native collection system. This week we’ll continue on that journey and grapple with even more challenges in this new, unexplored area of Unity.

Read the rest of this article »

No Comments

NativeLinkedList<T>: Part 2

Tags: , ,

Continuing from last time, today we’ll greatly expand on the fledgling NativeLinkedList<T> that we started last time. By the end of the article, we’ll have a useful native collection available to us!

Read the rest of this article »

No Comments

NativeLinkedList<T>: Part 1

Tags: , ,

Unity 2018.1 shipped with just one true native container: NativeArray<T>. Now Unity 2018.2 has been released and there is still just the one native container. We’ve seen how to implement more, but never wrote much more than a proof of concept. Today we’ll begin implementing NativeLinkedList<T> as an example of a native container for a very well known, simple data type. The result is available on GitHub for any project to use.

Read the rest of this article »

No Comments

Linked Lists Are Slow

Tags: , , ,

Contrary to what you may have learned in a data structures class, linked lists are virtually always slower than just using arrays. The same goes for array wrapper classes like List. Today’s article discusses why this is the case and tests it out with a C# Unity app to make sure that the real world validates the theory.

Read the rest of this article »

7 Comments

Even Faster Linked Lists

Tags: , , , , ,

Linked lists can be much faster than AS3’s Array and Vector classes if you use them under the right circumstances. It’s been over a year and a half since I last visited the topic, but today it’s time to update my LinkedList class. Read on for the freshly-optimized code and all-new performance testing and analysis!

Read the rest of this article »

47 Comments

Linked Lists: Part 3

Tags: , ,

Continuing in the series on linked lists that started with parts one and two, today I’ll make the first serious optimization pass on the LinkedList implementation. Read on for how successful this is.

Read the rest of this article »

1 Comment

Linked Lists: Part 2

Tags: , ,

Last time I began covering linked lists in AS3. As anyone who has ever taken a data structures class can tell you, this is definitely a core data structure. As such, it has numerous benefits compared to other single-dimensional data structures like arrays and hash tables. The Array class in AS3 is far from a C/C++ array, which is simply a contiguous block of memory. AS3’s Array class blurs the lines between arrays, linked lists, and hash tables. So as I implement a linked list class in AS3 it is quite interesting to see how the normal pros and cons change. I’ve expanded on the LinkedList class I started last week and done some more preliminary performance testing. Read on to see the updates.

Read the rest of this article »

2 Comments

Linked Lists: Part I

Tags: , ,

I’ve written before about linked lists when I covered free lists. There were massive speedups to be had there, but that article mostly covered the performance costs of allocation and deallocation. Today is part one of a series that more generally covers linked lists.

Read the rest of this article »

6 Comments