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
.
Posts Tagged map
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!
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!
Now that we know you can use int
keys with Object
, it’s time to test whether or not this is any faster than String
keys. Today’s article does just that and also tests int
and String
keys with Dictionary
.
Sometimes you need to map a key to many values, but AS3 has no built-in data structure for this purpose. Dictionary
and Object
are suitable one-to-one maps, but there’s been no one-to-many support until now. Read on for my own one-to-many class—MultiMap
—as well as performance testing and analysis.
XML is widely used in AS3 applications for everything from simple configuration files to complex networking protocols. AS3 even includes 10 operators in its syntax specifically to make XML easier to work with. This often leads to AS3 developers loading XML documents and then just leaving them as an XML
objects. XML’s performance begins to seep into the rest of the AS3 application. Today we look at just how much this can slow down our apps.
I recently received an e-mail from Dmitry Zhelnin (translation) with a test he did concerning the speed of a couple ways to get a value for a key, which I like to call a map and Wikipedia likes to call an associative array. I’d been meaning to do a similar test for a while now and, guess what, I finally have! UPDATE: fixed miss test for fixed-size Vectors.