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

Use Map and WeakMap to remove leaks and enhance perf #212

Merged
merged 4 commits into from
Aug 30, 2018
Merged

Conversation

alshakero
Copy link
Collaborator

Performance improvements:

add op: 117% faster
remove op: 109% faster
replace: 112% faster
test: 131%
geneate: 110% faster

Raw numbers

Before:

add operation
 Ops/sec: 3347825 ±4.97% Ran 212855 times in 0.064 seconds.
remove operation
 Ops/sec: 2846822 ±2.96% Ran 165023 times in 0.058 seconds.
replace operation
 Ops/sec: 3490267 ±4.53% Ran 210019 times in 0.060 seconds.
move operation
 Ops/sec: 248869 ±3.06% Ran 14581 times in 0.059 seconds.
copy operation
 Ops/sec: 165951 ±4.60% Ran 18362 times in 0.111 seconds.
test operation
 Ops/sec: 556021 ±9.20% Ran 37831 times in 0.068 seconds.

After:

add operation
 Ops/sec: 3937701 ±1.55% Ran 220030 times in 0.056 seconds.
remove operation
 Ops/sec: 3124531 ±1.10% Ran 169656 times in 0.054 seconds.
replace operation
 Ops/sec: 3924373 ±2.95% Ran 218723 times in 0.056 seconds.
move operation
 Ops/sec: 273714 ±1.22% Ran 15114 times in 0.055 seconds.
copy operation
 Ops/sec: 202550 ±2.24% Ran 18524 times in 0.091 seconds.
test operation
 Ops/sec: 733608 ±0.97% Ran 39733 times in 0.054 seconds.

✔️ All Tests are passing in IE

Fixes #208

@alshakero alshakero requested a review from tomalec August 29, 2018 12:32
@alshakero alshakero changed the title Use Maps and WeakMap to remove leaks and enhance perf Use Map and WeakMap to remove leaks and enhance perf Aug 29, 2018
Copy link
Collaborator

@tomalec tomalec left a comment

Choose a reason for hiding this comment

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

LGTM

@alshakero alshakero merged commit 0d6be6a into master Aug 30, 2018
@alshakero alshakero deleted the Use-Maps branch August 30, 2018 10:19
@warpech
Copy link
Collaborator

warpech commented Jun 28, 2019

✔️ All Tests are passing in IE

This PR broke compatibility with IE versions lower than 11. I am not saying this is a disaster, but it was worth noting, especially since another part in code still claims to support IE8.

I just added information about this to the release notes of 2.0.7

@alshakero
Copy link
Collaborator Author

See #223

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.

Memory leak when using observe
3 participants