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

Optimization: Profile filling in missing dates logic and shave ms #10

Open
mrjoelkemp opened this issue Oct 27, 2015 · 1 comment
Open

Comments

@mrjoelkemp
Copy link
Member

8 to 10ms per package adds up.

Substack has ~650 packages

  • 10ms * 650 packages = ~6.5s of filling in data

Is it moment that's taking a long time?

@mrjoelkemp
Copy link
Member Author

  1. One idea is to start with an object prefilled with the dates and the default zero values. Then loop over the fetched downloads list and overwrite the existing dates and values. You'd pay for the date math up front to fill the empty object. Not very dissimilar from what we have now.
  2. Pick a leaner date lib like datejs. Microbenchmarks show a 50% increase in speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant