zig/lib/compiler
Travis Staloch 8af59d1f98 ComptimeStringMap: return a regular struct and optimize
this patch renames ComptimeStringMap to StaticStringMap, makes it
accept only a single type parameter, and return a known struct type
instead of an anonymous struct.  initial motivation for these changes
was to reduce the 'very long type names' issue described here
https://github.com/ziglang/zig/pull/19682.

this breaks the previous API.  users will now need to write:
`const map = std.StaticStringMap(T).initComptime(kvs_list);`

* move `kvs_list` param from type param to an `initComptime()` param
* new public methods
  * `keys()`, `values()` helpers
  * `init(allocator)`, `deinit(allocator)` for runtime data
  * `getLongestPrefix(str)`, `getLongestPrefixIndex(str)` - i'm not sure
     these belong but have left in for now incase they are deemed useful
* performance notes:
  * i posted some benchmarking results here:
    https://github.com/travisstaloch/comptime-string-map-revised/issues/1
  * i noticed a speedup reducing the size of the struct from 48 to 32
    bytes and thus use u32s instead of usize for all length fields
  * i noticed speedup storing KVs as a struct of arrays
  * latest benchmark shows these wall_time improvements for
    debug/safe/small/fast builds: -6.6% / -10.2% / -19.1% / -8.9%. full
    output in link above.
2024-04-22 15:31:41 -07:00
..
aro ComptimeStringMap: return a regular struct and optimize 2024-04-22 15:31:41 -07:00
aro_translate_c Update usages of fmtId/isValidId 2024-04-07 14:47:11 +02:00
reduce reduce: fix compile errors 2024-03-24 17:29:39 +01:00
resinator ComptimeStringMap: return a regular struct and optimize 2024-04-22 15:31:41 -07:00
aro_translate_c.zig Update uses of @fieldParentPtr to use RLS 2024-03-30 20:50:48 -04:00
build_runner.zig std.Build: revert --host-target, --host-cpu, --host-dynamic-linker 2024-04-18 03:02:13 -07:00
fmt.zig move lazily compiled source files to lib/compiler/ 2024-02-26 23:43:56 -07:00
libc.zig zig libc: allow non-native targets 2024-03-13 02:17:28 -04:00
objcopy.zig extract std.posix from std.os 2024-03-19 11:45:09 -07:00
reduce.zig move lazily compiled source files to lib/compiler/ 2024-02-26 23:43:56 -07:00
std-docs.zig zig std accepts --port and --no-open-browser (#19559) 2024-04-06 15:18:43 -04:00
test_runner.zig Use @TypeOf instead of std.meta in test_runner.zig 2024-04-07 21:16:29 +02:00