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

attachEpoch uses defineProperty which makes it slow #28

Open
pbadenski opened this issue Nov 13, 2019 · 0 comments
Open

attachEpoch uses defineProperty which makes it slow #28

pbadenski opened this issue Nov 13, 2019 · 0 comments

Comments

@pbadenski
Copy link

I found this problem when profiling our application code. attachEpoch comes up quite clearly as at the top suspect for slow down. Interestingly when I looked at setTimeZone the zone property is added via assignment and it's only the epoch property that is added via defineProperty. Is it possible to change attachEpoch to add epoch via assignment?

Adding property through assignment is 2 orders of magnitude faster (see https://jsperf.com/object-defineproperty-vs-assignment/3)

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

No branches or pull requests

1 participant