1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

Kernel: Add a 1-deep cache to Process::region_from_range()

This simple cache gets hit over 70% of the time on "g++ Process.cpp"
and shaves ~3% off the runtime.
This commit is contained in:
Andreas Kling 2020-01-19 16:44:37 +01:00
parent ae0c435e68
commit 8d9dd1b04b
2 changed files with 14 additions and 1 deletions

View file

@ -452,6 +452,11 @@ private:
Region* region_containing(const Range&);
NonnullOwnPtrVector<Region> m_regions;
struct RegionLookupCache {
Range range;
Region* region { nullptr };
};
RegionLookupCache m_region_lookup_cache;
pid_t m_ppid { 0 };
mode_t m_umask { 022 };