

Each time a variable is added, the size of the array was expanded by 1 slot (using ReDim Preserve). However, for the Get loop, instead of using a for-loop with an index, I used a for-each loop.ĭynamic array typed was a custom class containing an array of type SpeedTester. The next two methods were identical to the first two in the way variables were added to the collection. These objects were then accessed in a for-loop using an index from 1 to c.Count The first were added with no key, the second was added with a key which was the object's long property converted into a string. The methods Collection Indexed and Collection Mapped involved holding the objects in a collection. The results are as follows: Method Avg Add Time Avg Get Time Total TimeĬollection Indexed For Each 0.334 0.033 0.367Ĭollection Mapped For Each 1.084 0.039 1.123 I performed 3 rounds per method, and averaged the times for the And and get loops. Then I did a second loop, which involved accessing each object in the collection/array and assigning the object's long property value to a new variable of type long. The value of the variable was the value of the loop index (between 1 and 100,000) I followed Tim Williams's advice and did some speed tests.įor each type of collection/array, I first added 100,000 objects of class "SpeedTester", which was simply a shell object holding a long variable (with get/set properties). Does this apply to non-keyed collections, or only key-value-mapped collections? How much slower is it to use variants than typed objects? Note that I will always be casting the variant objects in the array directly to a typed variable upon retrieval, a la: Dim myObject As M圜lassĭoes casting improve speed, or does vba still have to perform all the type-checking associated with variants?Īlso, would this second option be faster than using a non-keyed Collection? I have read that Collection iteration is slow, that they are designed for lookup. Obviously this is a lot less work, but I am concerned about speed. The second option is to develop a single 'List' class, with the same methods, using the Variant data type. The first option is to develop a 'List' class for each object type, with methods for adding objects (and expanding the array), getting the First and Last indexes and the object count, and retrieving an object by index (the latter 4 will include error handling in case the array is empty). Mostly I will be iterating through arrays, thus use of a keyed collection is not ideal. An array may hold any number of objects, potentially thousands, of a single class, but not objects of multiple classes. Duncan Toysĭuncan Toys is a company that produces a variety of toys and games, including a line of stacking cups similar to those used in speed stacking.My project requires a bunch of dynamically-resizable arrays for different objects. Sport Stacking is a brand that produces a similar line of speed stacking cups and equipment, and also organizes competitions through the World Sport Stacking Association.


In 2006, Speed Stacks established the World Sport Stacking Association (WSSA), which sets official rules and organizes tournaments for the sport.įrom 2007 to 2017, the WSSA held 10 world championships, with winners hailing from countries such as the United States, South Korea, and Germany.Īs of 2021, Speed Stacks continues to be a leading brand in the world of speed stacking and is used by both professionals and beginners alike.īrands Similar to Speed Stacks Sport Stacking

In 2001, Speed Stacks began producing their own specialized plastic cups customized for speed stacking competitions. Speed Stacks is a brand that produces cups and other equipment for speed stacking, a sport that involves quickly stacking and unstacking plastic cups in predetermined sequences.įounded in 1998 by Bob Fox, a physical education teacher who developed the concept of speed stacking as a way to improve hand-eye coordination and spatial awareness in his students. Explore About Speed Stacks & Its Products
