Ordnung

Fast, vector-based map implementation that preserves insertion order.

When should you use this?

Benchmarks

Map construction

While insertion in Ordnung is getting progressively slower as the size of the map grows, growing a HashMap is also getting progressively slower due to re-bucketing costs.

Map construction benchmark

Map construction with preallocated memory

With preallocated memory, Ordnung is still faster for a small number of entries.

Map construction benchmark with preallocated memory

Average time to find value by key

As the size of the map doubles, Ordnung incurs a roughly constant jump in cost due to its ~O(log n) nature, however it still remains competitive with fast HashMaps.

Map find benchmark

License

This code is distributed under the terms of both the MIT license and the Apache License (Version 2.0), choose whatever works for you.

See LICENSE-APACHE and LICENSE-MIT for details.