Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(base): Make
Store::get_rooms
wayyy faster.
`Store::get_rooms` worked as follows: For each room ID, call * Take the read lock for `rooms`, * For each entry in `rooms`, take the room ID (the key), then call `Store::get_room`, which… * Take the read lock for `rooms`, * Based on the room ID (the key), read the room (the value) from `rooms`. So calling `get_rooms` calls `get_room` for each room, which takes the lock every time. This patch modifies that by fetching the values (the rooms) directly from `rooms`, without calling `get_room`. In my benchmark, it took 1.2ms to read 10'000 rooms. Now it takes 542µs. Performance time has improved by -55.8%.
- Loading branch information