Skip to content
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

Merged
merged 10 commits into from
Nov 22, 2019
Merged

V1.5.1-beta #9008

merged 10 commits into from
Nov 22, 2019

Conversation

arindam1993
Copy link
Contributor

Adds the following fixes to release-sangria

msbarry and others added 5 commits November 21, 2019 13:50
* 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)
@arindam1993 arindam1993 self-assigned this Nov 22, 2019
@@ -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 {
Copy link
Contributor

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 ...

Copy link
Member

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo of 'Returns'

Copy link
Contributor

@chloekraw chloekraw left a 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))
Copy link
Contributor

@chloekraw chloekraw Nov 22, 2019

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

Copy link
Contributor

@chloekraw chloekraw Nov 22, 2019

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 (?)

Copy link
Contributor

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 of Transferables when posting messages (note the typo) to WebWorkers.

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))
Copy link
Contributor

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

@arindam1993 arindam1993 merged commit 50c9746 into release-sangria Nov 22, 2019
@arindam1993 arindam1993 deleted the v1.5.1-beta branch November 22, 2019 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants