Tensegritics / ClojureDart

Clojure dialect for Flutter and Dart
1.43k stars 91 forks source link

Make small literal maps cheaper #317

Open cgrand opened 3 months ago

cgrand commented 3 months ago

ClojureDart doesn't have ArrayMaps. Allocating small maps is thus more expensive than with array maps. This could be optimized in many cases by detecting literal maps whose keys don't conflicts on the lowest 5 bits and emitting special code to allocate straight from the array + precomputed bitmaps. This can be done in macro land the only little blocker is to make cljd-hash accessible to the macro.