diff options
| author | Mark Rowe <mrowe@bdash.net.nz> | 2025-01-13 22:19:17 -0800 |
|---|---|---|
| committer | kat <kat@vector35.com> | 2025-01-15 09:49:10 -0500 |
| commit | b14f86d5373eb7a4a8a40c9a23c3a9faf2732eeb (patch) | |
| tree | ba09ec39132d6c02b01f391867b44ed0872cda4e /python | |
| parent | 0cea9333ac85d372cfa4be639e2fa4148153b3dc (diff) | |
[SharedCache] Avoid copying strings on each call to VM::MappingAtAddress
`PageMapping` was storing the path to the file it points within. This
was causing unnecessary work within `VM::MappingAtAddress` as the
`PageMapping`, and thus the path, is copied into the return value. This
copying was more expensive than the map lookup.
The file path is now stored within a `LazyMappedFileAccessor` class that
wraps the `SelfAllocatingWeakPtr`. This means the path is still
available via the `PageMapping`, but it does not need to be copied as
often.
This includes two additional improvements / optimizations while I was
touching the code in question:
1. `MMappedFileAccessor::Open` no longer performs two hash lookups when
a file accessor already exists.
2. `VM::MapPages` takes the path by const reference to avoid an
unnecessary copy.
Diffstat (limited to 'python')
0 files changed, 0 insertions, 0 deletions
