alufolie91
014a22e933
w_wad: replace unordered_map with verstable hashmap for lumpnumcache + convert back to C from C++
...
been rethinking this and been doing some digging online
the unordered_map was just a quick and simple fix for performance issues in blan, but came with caveats:
- unordered_map is simple to use but not particulary great in terms of performance during lookups especially
- we needed to convert w_wad to c++ just for the lumpnumcache
- due to needing to preserve the key since they gotta outlive the scope of the function that inserts things into the map, we effectively did a string copy on each map insert and lookup
after some research came across verstable, which is basically almost the exact same as unordered map but in C while being extremely fast (even more with its builtin string hash and comparisor)
only caveat with verstable is we need to rely on a new lib, though its just a single header file, and we gotta manage ensuring the input keys outlive functionscope ourselves, which we do with strdup in this case
good thing, verstable allows to call a "destructor" specified by us whenever it removes or replaces keys in the map
this also means we only need to copy strings on insert and not on lookup anymore
all in all this is much faster while giving us the simple usage of c++ unordered_map while staying in C
due to the strdup quirk i had to slightly modify verstable to allow to take const as inputs for the getter functions even if the keys themselves are not const marked with "KEY_GET_CONST"
Verstable can be found here: https://github.com/JacksonAllan/Verstable
and is licensed under MIT which is perfect!
2026-02-24 16:06:27 +01:00
..
2025-12-27 15:07:13 +01:00
2026-02-22 14:01:27 +01:00
2025-10-03 16:39:51 +02:00
2026-02-24 16:06:27 +01:00
2026-02-23 17:58:53 +01:00
2026-01-16 12:02:21 +03:00
2026-02-24 16:06:27 +01:00
2026-01-16 12:53:34 +01:00
2025-12-01 20:19:03 +01:00
2025-09-28 16:14:56 +02:00
2025-12-02 12:48:43 +01:00
2025-10-03 16:39:51 +02:00
2025-11-05 23:04:13 +01:00
2026-02-24 15:54:47 +01:00
2026-02-16 19:27:56 +01:00
2026-01-21 18:23:21 +01:00
2026-01-21 19:09:50 +01:00
2026-02-23 19:14:14 +03:00
2025-12-05 14:59:36 +01:00
2025-11-06 19:01:25 +01:00
2026-02-24 12:34:21 +01:00
2025-12-01 21:57:57 +01:00
2026-02-23 17:58:53 +01:00
2025-11-23 17:59:51 +01:00
2026-01-02 18:34:10 +01:00
2025-09-30 19:35:23 +02:00
2026-02-01 02:49:03 +03:00
2025-11-01 16:32:16 +01:00
2026-01-11 19:46:46 +01:00
2026-01-11 19:46:46 +01:00
2025-09-20 16:34:17 +02:00
2025-11-01 23:15:21 +01:00
2025-10-03 16:39:51 +02:00
2025-09-12 15:59:59 +02:00
2025-12-02 12:48:43 +01:00
2026-02-16 19:27:56 +01:00
2025-12-05 14:59:36 +01:00
2025-11-01 23:15:21 +01:00
2025-10-18 16:15:17 +02:00
2025-09-24 21:23:58 +02:00
2026-02-08 20:35:08 +01:00
2025-12-05 01:07:14 +01:00
2026-02-23 18:17:40 +01:00
2026-02-02 16:12:38 +01:00
2026-02-24 12:34:21 +01:00
2025-12-16 17:52:13 +01:00
2026-02-02 16:12:38 +01:00
2025-10-18 16:15:14 +02:00
2026-02-06 20:06:56 +01:00
2025-12-01 20:19:11 +01:00
2026-02-23 17:58:53 +01:00
2026-01-08 00:40:24 +01:00
2026-02-01 02:49:03 +03:00
2026-02-01 02:49:03 +03:00
2026-02-22 13:33:54 +01:00
2026-02-06 20:06:56 +01:00
2025-11-24 21:26:07 +01:00
2025-06-07 20:05:48 +02:00
2025-12-04 01:23:42 +01:00
2025-11-17 04:56:55 +01:00
2026-02-23 16:20:48 +01:00
2026-02-02 16:12:38 +01:00
2025-06-07 20:05:48 +02:00
2026-01-02 18:34:10 +01:00
2025-12-27 15:07:13 +01:00
2025-09-15 14:07:21 +02:00
2025-12-26 18:58:41 +01:00
2025-08-03 16:23:00 +02:00
2025-10-03 16:39:51 +02:00
2026-02-22 13:33:49 +01:00
2025-12-05 17:29:46 +01:00
2026-02-22 13:33:46 +01:00
2025-11-24 00:35:25 +01:00
2026-02-02 16:12:38 +01:00
2025-10-04 17:25:03 +03:00
2026-01-21 23:38:41 +03:00
2025-08-03 16:23:00 +02:00
2025-11-01 23:45:22 +01:00
2025-04-29 21:38:28 +02:00
2025-10-23 22:52:03 +03:00
2026-02-06 17:06:04 +01:00
2026-02-02 16:12:38 +01:00
2025-12-02 23:59:02 +03:00
2026-01-21 19:49:55 +01:00
2025-10-03 16:39:51 +02:00
2025-08-03 16:15:15 +02:00
2025-08-03 16:15:15 +02:00
2026-01-08 00:40:24 +01:00
2025-09-19 02:06:05 +03:00
2026-01-21 19:49:55 +01:00
2025-11-01 21:21:06 +01:00
2025-06-07 01:20:31 +02:00
2025-05-28 18:25:07 +02:00
2025-10-04 17:25:03 +03:00
2025-10-04 17:25:03 +03:00
2025-11-06 19:15:59 +01:00
2025-12-05 14:59:36 +01:00
2025-12-06 19:40:54 +01:00
2025-09-05 20:05:10 +02:00
2026-02-06 17:06:33 +01:00
2025-06-02 15:57:43 -05:00
2025-11-12 16:49:44 +01:00
2025-06-06 00:04:19 +02:00
2026-01-23 18:33:08 +01:00
2026-02-02 16:12:38 +01:00
2025-10-03 16:39:51 +02:00
2025-10-04 17:25:03 +03:00
2025-10-04 17:25:03 +03:00
2025-09-24 21:23:58 +02:00
2025-11-30 00:36:36 +03:00
2026-01-21 18:23:21 +01:00
2025-11-06 17:37:19 +01:00
2026-02-02 16:11:54 +01:00
2026-02-23 19:14:14 +03:00
2025-12-11 17:35:35 +03:00
2026-02-09 16:09:26 +01:00
2026-02-24 15:54:47 +01:00
2026-02-08 20:35:08 +01:00
2026-01-08 00:40:24 +01:00
2025-05-03 20:45:40 +02:00
2025-08-16 22:20:48 +02:00
2025-08-03 16:23:00 +02:00
2025-11-26 22:56:04 +03:00
2025-11-23 01:31:38 +03:00
2026-02-23 17:58:36 +01:00
2025-09-24 21:23:58 +02:00
2025-12-05 14:59:36 +01:00
2026-02-22 13:33:57 +01:00
2025-10-27 22:47:18 +01:00
2025-11-27 16:49:50 +01:00
2026-01-08 00:40:24 +01:00
2025-12-02 12:48:47 +01:00
2026-02-16 19:27:52 +01:00
2025-09-12 15:59:59 +02:00
2026-02-16 19:27:52 +01:00
2025-11-25 22:53:30 +01:00
2025-11-25 20:15:27 +01:00
2025-09-17 17:42:16 +02:00
2026-02-16 19:27:52 +01:00
2026-02-05 20:07:44 +01:00
2025-12-27 10:32:16 +01:00
2025-08-06 00:10:47 +02:00
2025-09-28 16:14:56 +02:00
2025-12-10 18:22:34 +01:00
2026-02-02 16:12:38 +01:00
2025-09-18 18:20:26 +02:00
2025-08-03 16:23:00 +02:00
2025-11-24 17:44:13 +01:00
2025-04-20 23:01:53 +02:00
2026-02-16 19:27:52 +01:00
2025-09-12 18:06:26 +02:00
2025-11-25 22:53:30 +01:00
2026-02-05 20:07:41 +01:00
2026-01-21 18:23:21 +01:00
2026-02-16 19:27:52 +01:00
2025-10-03 22:41:02 +01:00
2025-06-21 18:07:41 +02:00
2025-12-04 15:41:20 +01:00
2025-11-27 16:49:38 +01:00
2026-02-24 15:54:47 +01:00
2025-11-11 14:19:02 +01:00
2025-11-27 16:49:50 +01:00
2025-10-26 14:05:12 +01:00
2025-10-20 16:32:48 +02:00
2025-11-19 18:12:20 +01:00
2026-02-22 13:33:46 +01:00
2025-10-19 22:19:20 +02:00
2025-12-05 03:10:41 +03:00
2026-01-21 18:23:21 +01:00
2025-06-06 00:04:19 +02:00
2026-02-02 16:12:38 +01:00
2026-01-21 18:23:21 +01:00
2026-02-02 16:12:38 +01:00
2025-10-13 19:20:40 +02:00
2025-11-19 18:12:20 +01:00
2025-06-07 01:20:34 +02:00
2026-02-01 20:52:48 +01:00
2025-10-05 20:10:16 +02:00
2026-01-23 18:33:08 +01:00
2025-06-08 20:03:06 +02:00
2026-02-01 16:27:25 +01:00
2025-10-05 20:10:16 +02:00
2026-01-08 00:40:24 +01:00
2026-02-22 13:33:46 +01:00
2025-11-11 14:19:02 +01:00
2025-06-23 19:20:20 +02:00
2025-06-04 23:03:14 +02:00
2025-06-04 23:03:14 +02:00
2025-06-04 23:03:14 +02:00
2026-02-23 17:09:32 +01:00
2025-11-26 10:09:52 +01:00
2026-02-24 15:54:47 +01:00
2026-01-08 00:40:24 +01:00
2025-11-19 00:26:07 +01:00
2026-01-22 14:26:24 +01:00
2025-11-12 16:49:44 +01:00
2025-08-02 01:00:58 +02:00
2026-02-24 16:06:27 +01:00
2026-02-10 16:38:37 +01:00
2026-02-10 16:38:37 +01:00
2026-02-23 17:58:50 +01:00
2025-08-28 15:51:57 +01:00
2025-09-28 16:14:56 +02:00
2025-06-06 00:04:19 +02:00
2026-02-02 16:12:38 +01:00
2025-10-25 22:21:37 +02:00
2026-02-24 16:06:27 +01:00
2026-02-24 16:06:27 +01:00
2026-02-24 16:06:27 +01:00
2026-01-08 00:40:24 +01:00
2025-12-02 23:59:02 +03:00
2025-12-26 21:44:58 +01:00
2026-02-02 16:12:38 +01:00