-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V1.5.1-beta #9008
V1.5.1-beta #9008
Conversation
* reproduce animate jankiness * Fix animation performance * use isWorker (cherry picked from commit 6b49bfd)
We are periodically removing items from the cache using the CacheStorage API. Unfortunately, Safari seems to leak significant amounts of memory when requesting a new Cache object, then calling `cache.keys()`. Instead of requesting a new Cache object for every operation, we are now reusing the same Cache object for all operations on the cache. Ticketed upstream at https://bugs.webkit.org/show_bug.cgi?id=203991 (cherry picked from commit 6b424fe)
@@ -119,7 +119,7 @@ function isArrayBuffer(val: any): boolean { | |||
* | |||
* @private | |||
*/ | |||
export function serialize(input: mixed, transferables?: Array<Transferable>): Serialized { | |||
export function serialize(input: mixed, transferables: ?Array<Transferable>): Serialized { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised these aren't equivalent. What's the difference? An optional parameter vs a parameter with an optional value ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -409,6 +409,18 @@ export function sphericalToCartesian([r, azimuthal, polar]: [number, number, num | |||
}; | |||
} | |||
|
|||
/* global self, WorkerGlobalScope */ | |||
/** | |||
* Retuns true if the when run in the web-worker context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo of 'Returns'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍏 minus the nits
CHANGELOG.md
Outdated
|
||
## 🍏 Improvements | ||
* Implement workaround for memory leak in Safari when using the Cache API. ( [#8856](https://github.com/mapbox/mapbox-gl-js/pull/8956)) | ||
* Implement workaround for memory leak in Safari when using Transferable objects to transfer ArrayBuffers. This involves browser detecting Safari and disabling the use of Transferables when posting messags to WebWorkers. ( [#9003](https://github.com/mapbox/mapbox-gl-js/pull/9003)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's continue to format Transferable
in this way just like the top of the changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe ArrayBuffers
should also be formatted that way for consistency (?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I feel the second sentence could be cleaned up. how about something like:
...
ArrayBuffers
. If the Safari browser is detected, this workaround disables the use ofTransferables
when posting messages (note the typo) toWebWorkers
.
CHANGELOG.md
Outdated
This patch introduces two workarounds that address longstanding issues related to unbounded memory growth in Safari, including [#8771](https://github.com/mapbox/mapbox-gl-js/issues/8771) and [#4695](https://github.com/mapbox/mapbox-gl-js/issues/4695). We’ve identified two memory leaks in Safari: one in the [CacheStorage](https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage) API, addressed by [#8956](https://github.com/mapbox/mapbox-gl-js/pull/8956), and one in transferring data between web workers through [Transferables](https://developer.mozilla.org/en-US/docs/Web/API/Transferable)`, addressed by [#9003](https://github.com/mapbox/mapbox-gl-js/pull/9003). Because disabling `Transferables` may result in performance implications for Safari users on some implementations of GL-JS, we are publishing a beta patch release to enable developers to test the changes and provide feedback. | ||
|
||
## 🍏 Improvements | ||
* Implement workaround for memory leak in Safari when using the Cache API. ( [#8856](https://github.com/mapbox/mapbox-gl-js/pull/8956)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the top of the changelog calls the Cache API the CacheStorage
API -- let's maintain consistency in name and format
Adds the following fixes to release-sangria