You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
Noticed this when I was exploring the codebase the other day. In a highly concurrent environment, the "dog-piling effect" might cause unnecessary cache writes and wasteful recomputations for the same missing keys.
Upon a cache miss, Contile currently relies on the request handler to fetch the missing tiles from content partners and store the result in the local cache. Given Firefox's user base, it's possible to have multiple requests asking for tiles for the same missing cache key at the same time. In that case, each one of them would try to make an external tile request and then write the result to the cache, which could be redundant and unnecessary if the cached value is identical.
While this is not a logical problem, the underlying overheads, such as locking and issuing external requests, might have a negative impact. Also, this effect could be worse when we add cache TTL and emergency purging functionalities in the future.
I've made this example to demonstrate this issue and provided a solution to it. Will prepare a patch later.
┆Issue is synchronized with this Jira Task
┆Epic: Contile Shared tiles cache
The text was updated successfully, but these errors were encountered:
Noticed this when I was exploring the codebase the other day. In a highly concurrent environment, the "dog-piling effect" might cause unnecessary cache writes and wasteful recomputations for the same missing keys.
Upon a cache miss, Contile currently relies on the request handler to fetch the missing tiles from content partners and store the result in the local cache. Given Firefox's user base, it's possible to have multiple requests asking for tiles for the same missing cache key at the same time. In that case, each one of them would try to make an external tile request and then write the result to the cache, which could be redundant and unnecessary if the cached value is identical.
While this is not a logical problem, the underlying overheads, such as locking and issuing external requests, might have a negative impact. Also, this effect could be worse when we add cache TTL and emergency purging functionalities in the future.
I've made this example to demonstrate this issue and provided a solution to it. Will prepare a patch later.
┆Issue is synchronized with this Jira Task
┆Epic: Contile Shared tiles cache
The text was updated successfully, but these errors were encountered: