[关闭]
@WrRan 2016-11-24T08:33:46.000000Z 字数 2923 阅读 966

sails

Benchmarks

Run the benchmarks

From the root directory of sails:

  1. $ mocha test/benchmarks

To get a more detailed report with millisecond timings for each benchmark, run:

  1. $ mocha test/benchmarks -v

Goals

These tests are related to benchmarking the performance of different parts of Sails. For now, our benchmark tests should be "integration" or "acceptance" tests. By that, I mean they should measure a specific "user action" (e.g. running sails new, running sails lift, sending an HTTP request to a dummy endpoint, connecting a Socket.io client, etc.).

Why test features first, and not each individual method?

Feature-wide benchmarks are the "lowest-hanging fruit", if you will. We'll spend much less development time, and still get valuable benchmarks that will give us ongoing data on Sails performance. This way, we'll know where to start writing lower-level benchmarks to identify choke-points.

Writing good benchmarks

Advice from Felix Geisendörfer (@felixge)

Things to test

Here are the most important things we need to benchmark:

Features:

Thankfully, the ORM is already covered by the benchmarks in Waterline core and its generic adapter tests.

Measuring:
Under varying levels of stress:
In varying environments:

Considerations

Some important things to consider when benchmarking Node.js / Express-based apps in general:

Sources:
+ https://groups.google.com/forum/#!topic/nodejs/tgATyqF-HIc

Benchmarking libraries

Don't know the best route here yet-- but here are some links for reference. Would love to hear your ideas!

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注