DimensionalMap: Accelerating the heat-death of the Universe

I thought I was being clever with my DimensionalMap subproject:  bootstrapping on top of the Map object to build a multi-dimensional hashtable.  Then I started using it heavily in my Verbosio Templates subproject to implement a very customized Document Object Model in JavaScript.  With over 900 Jasmine tests passing, execution time was averaging about 4 seconds.

However, I suspected my use of DimensionalMap was unnecessary – particularly since I was working with only one dimension at the time.  So in a quick experiment, I replaced the code that used it with code using WeakMap.  Total execution time with the same tests:  about 1.5 seconds.

Ouch.  I still think the API is a good one, but clearly the implementation has issues.

Hey, kids!  Wanna build your JavaScript profiling skills?  Help me find the spots that are causing unnecessary slowness!  I’ll be happy to write a letter of appreciation for anyone who wants to take it on.  As always, the code is available under Mozilla Public License 2.0, GPL 3 and LGPL 3.  (Childhood not required for participation.)