Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake image cache per-document rather than global #15701
Comments
|
This would help #14993. |
|
Sounds very interesting. Happy to work on it. Thank you @jdm |
|
This comes at the cost of memory though. Is the image cache slow, or is this motivated solely by messaging races? |
|
Gecko is working on removing as much synchronous IPC as possible. If we do a per-similar-origin cache, we should get the main memory benefits of sharing that a global cache provides today. |
|
I guess one point is that if we're going to make it a threadsafe data structure, why restrict it to similar-origin? Why not just pass the reference to the threadsafe hashmap (or whatever) in place of the channel we currently use? This gives us one cache per content process. |
Make image cache per-document rather than global - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15701. - [X] These changes do not require new tests because there should already be WPTs for image loads. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16048) <!-- Reviewable:end -->
Make image cache per-document rather than global - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15701. - [X] These changes do not require new tests because there should already be WPTs for image loads. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16048) <!-- Reviewable:end -->
This would remove any issues related to multiple pages loading the same URL but using different request parameters, and would also avoid the need for synchronous IPC every time the image cache needs to be queried. Rather than a separate thread with an event loop, we'll want a threadsafe data structure that can be used from both the script and layout threads.