aboutsummaryrefslogtreecommitdiff
path: root/src/hash_map.hpp
AgeCommit message (Collapse)Author
2020-09-21rename src-self-hosted/ to src/Andrew Kelley
2020-07-03stage1 HashMap: linear scan for < 16 entriesAndrew Kelley
2020-07-02stage1 HashMap: store hash & do robin hood hashingAndrew Kelley
This adds these two fields to a HashMap Entry: uint32_t hash uint32_t distance_from_start_index Compared to master branch, standard library tests compiled 8.4% faster and took negligible (0.001%) more memory to complete. The amount of memory used is still down from before 8b82c4010480 which moved indexes to be stored separately from entries. So, it turns out, keeping robin hood hashing plus separating indexes did result in a performance improvement. What happened previously is that the gains from separating indexes balanced out the losses from removing robin hood hashing, resulting in a wash. This also serves as an inspiration for adding a benchmark to std.AutoHashMap and improving the implementation.
2020-07-02stage1: reimplement HashMapAndrew Kelley
The indexes are stored separately using an array of uint8_t, uint16_t, uint32_t, or size_t, depending on the number of entries in the map. Entries only contain a key and a value, no longer have distance_from_start_index or is_used. In theory this should be both faster and use less memory. In practice it seems to have little to no effect. For the standard library tests, vs master branch, the time had no discernable difference, and it shaved off only 13 MiB of peak rss usage.
2020-02-10stage1: memory/report overhaulMichael Dusan
- split util_base.hpp from util.hpp - new namespaces: `mem` and `heap` - new `mem::Allocator` interface - new `heap::CAllocator` impl with global `heap::c_allocator` - new `heap::ArenaAllocator` impl - new `mem::TypeInfo` extracts names without RTTI - name extraction is enabled w/ ZIG_ENABLE_MEM_PROFILE=1 - new `mem::List` takes explicit `Allocator&` parameter - new `mem::HashMap` takes explicit `Allocator&` parameter - add Codegen.pass1_arena and use for all `ZigValue` allocs - deinit Codegen.pass1_arena early in `zig_llvm_emit_output()`
2019-11-25const interning for 1-possible-value typesMichael Dusan
2016-12-01rewrite scope implementationAndrew Kelley
* now there are not extra unused hash tables * each variable declaration opens a new scope inside a function
2016-03-01better hash table performanceAndrew Kelley
2016-02-01remove the constructor of hash mapAndrew Kelley
2016-01-27c_import of stdio.h works for some functionsAndrew Kelley
See #88
2015-11-24write object file and fix void return typeAndrew Kelley
2015-11-23semantic analysis checks for multiple definitions of functionsAndrew Kelley