[go: nahoru, domu]

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

Performance tests #397

Open
rxaviers opened this issue Feb 17, 2015 · 1 comment
Open

Performance tests #397

rxaviers opened this issue Feb 17, 2015 · 1 comment

Comments

@rxaviers
Copy link
Member

Goal

Test the performance impact of fixes/changes. So, we ensure our performance is continuously improved; In other words, we're interested in comparing how fixes or changes affect the systemic performance of the library.

General Ideas

  • We need to compare the performance before and after a change. Therefore, we need a metric describing how fast Globalize performs what it's supposed to.
  • We're interested in the systemic performance of the library. Therefore, performance tests performance/* should use the built files dist/* (and public methods Globalize.*), analogous to the functional tests test/functional/*.
  • Keep it simple. The performance tests are about generating the performance metrics (benchmark). A second and different problem is about comparing two different results. For this one, consider something analogous to https://github.com/rwaldron/grunt-compare-size.

Workload

  • We need to define that. It should reflect what Globalize applications look like.
  • Vyacheslav Egorov talks about shitty workloads you should avoid.

References

@jzaefferer
Copy link
Contributor

A few workloads (aka usecases) I can think of:

  • Spinner: Parse and format input value; while spinning, a few ops/s, but hardly more. Would use formatter and parse instances.
  • Datepicker: Load display data to render datepicker; parse input from user (while typing); format selected date. So parsing and formatting is at most a few ops/s.
  • Template rendering: Format up to a few hundred numbers, currencies and dates to show on a page. Would use formatter and parse instances.
  • Form validation: Parse several (a dozen or two) dates/numbers/currencies on submit of a form, to validate each

For any repetitive tasks, formatters and parsers can be assumed, so the performance of one-off methods like formatDate isn't criticial in these usecases. In others they are, though.

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

2 participants