0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

534 Commits

Author SHA1 Message Date
Rich Trott
5c2707c1b2 doc: benchmark/README.md copyedit
PR-URL: https://github.com/nodejs/io.js/pull/1970
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-06-15 08:44:11 -07:00
Brendan Ashworth
9da168b71f buffer: optimize Buffer.byteLength
Buffer.byteLength is important for speed because it is called whenever a
new Buffer is created from a string.

This commit optimizes Buffer.byteLength execution by:
- moving base64 length calculation into JS-land, which is now much
  faster
- remove redundant code and streamline the UTF8 length calculation

It also adds a benchmark and better tests.

PR-URL: https://github.com/nodejs/io.js/pull/1713
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-05-22 15:31:03 -07:00
Brian White
c7782c0af8 node: improve nextTick performance
This commit uses separate functions to isolate deopts caused by
try-catches and avoids fn.apply() for callbacks with small numbers
of arguments.

These changes improve performance by ~1-40% in the various
nextTick benchmarks.

PR-URL: https://github.com/iojs/io.js/pull/1571
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-05-01 21:27:34 -04:00
Jackson Tian
d2b62a4973 benchmark: don't check wrk in non-http benchmark
When running a non-http benchmark, there is no need the check for the
wrk tool so move the wrk check into the http method.

PR-URL: https://github.com/iojs/io.js/pull/1368
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-04-09 12:09:09 +02:00
Shigeki Ohtsu
3a69b7689b benchmark: add rsa/aes-gcm performance test
PR-URL: https://github.com/iojs/io.js/pull/1325
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-04-04 12:37:26 +09:00
Shigeki Ohtsu
1c709f3aa9 benchmark: add/remove hash algorithm
add sha1, sha512 algorithm and remove md5

PR-URL: https://github.com/iojs/io.js/pull/1325
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-04-04 12:37:26 +09:00
Brian White
a081c7c522 benchmark: fix chunky client benchmark execution
This commit fixes a few things for this benchmark:

1. Ensures the temporary directory for the unix socket exists.
2. Prevents the client code from being run directly because the
server script is the one that calls out the client code.
3. Ensures the server is closed once the client benchmarks have
finished.
4. Since this is an http benchmark, it should be moved to the http
benchmarks subdirectory.

PR-URL: https://github.com/iojs/io.js/pull/1257
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-04-03 00:56:45 -04:00
Brian White
8a945814dd string_decoder: optimize write()
By limiting property getting/setting to only where they are
absolutely necessary, we can achieve greater performance
especially with small utf8 inputs and any size base64 inputs.

PR-URL: https://github.com/iojs/io.js/pull/1209
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Nicu Micleușanu <micnic90@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-03-25 00:34:34 -04:00
Brendan Ashworth
c638dad567 benchmark: add output format option [csv]
This commit adds an `OUTPUT_FORMAT` environment variable option for
all benchmark tests that allow either 'csv' or 'default' output. Default
output has been left unchanged, and csv output prints out the csv
headers along with the csv formatted per-test output, each test also
seperated by a newline.

It can be used like the following:
$ OUTPUT_FORMAT=csv iojs benchmark/common.js http

Not specifying the OUTPUT_FORMAT env var will default to 'default'.
Specifying a bad value will throw an error.

PR-URL: https://github.com/iojs/io.js/pull/777
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-16 21:27:17 -07:00
Brendan Ashworth
97d8d4928d benchmark: add plot_csv R graphing script
This commit adds a graphing script (in R) for graphing the CSV output
of a benchmark. It can be run like this:

```
$ OUTPUT_FORMAT=csv iojs benchmark/http/client-request-body.js >
data.csv
$ ./benchmark/plot_csv.R data.csv graph.png bytes type
```

This will graph the output to `graph.png`, using the output's `bytes`
value as X and the result value for each as Y. Output will be grouped
by `type`.

Running as the example yields a beautiful graph like this:
http://pbrd.co/1vBhUfy.

PR-URL: https://github.com/iojs/io.js/pull/777
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-16 21:26:05 -07:00
Rudi Cilibrasi
030a92347d benchmark: chunky http client benchmark variation
PR-URL: https://github.com/iojs/io.js/pull/228
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-09 10:58:40 -06:00
Brian White
b27931b0fe benchmark: fix wrk check
PR-URL: https://github.com/iojs/io.js/pull/1076
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-03-05 17:13:08 -05:00
Johan Bergström
2b79052494 benchmark: check for wrk ahead of running benchmarks
PR-URL: https://github.com/iojs/io.js/pull/982
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-03-04 20:25:49 -08:00
Johan Bergström
a45d4f8fd6 build: remove tools/wrk from the tree
wrk is an optional tool that some of the http benchmarks uses. The removal
doesn't affect any users. Developers are assumed to install it before running
the tests.

This change reduces the tarball by 5%

PR-URL: https://github.com/iojs/io.js/pull/982
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-03-04 20:25:41 -08:00
Petka Antonov
8a1e22af3a benchmark: pass execArgv to the benchmarking process
Benchmarker should pass exec flags (e.g. --no-crankshaft,
--turbofan-filter, --trace-opt etc) to the benchmarking process

Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
PR-URL: https://github.com/iojs/io.js/pull/928
2015-02-24 15:55:12 -08:00
Brian White
35ed79932c benchmark: add a few querystring benchmarks
PR-URL: https://github.com/iojs/io.js/pull/847
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-02-14 23:41:52 -08:00
Ben Noordhuis
2c3121c606 benchmark: bump eventemitter number of iterations
Some of the benchmarks that were added in commit 847b9d2 complete too
quickly to draw meaningful conclusions from.  Increase the number of
iterations to make them run longer.

PR-URL: https://github.com/iojs/io.js/pull/746
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-02-07 00:54:38 +02:00
Brian White
847b9d212a benchmark: add more EventEmitter benchmarks
PR-URL: https://github.com/iojs/io.js/pull/730
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-02-06 21:33:44 +01:00
Brian White
e0730eeaa5 benchmark: allow compare via fine-grained filters
Before this commit, only benchmark targets defined in Makefile could
be used. This commit allows execution of common.js directly and
passing of filter arguments directly, allowing you to run either a
subset of benchmarks or a single specific benchmark for comparison.

PR-URL: https://github.com/iojs/io.js/pull/711
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-02-04 16:55:18 -05:00
Evan Lucas
3e675e44b5 benchmark: don't use template strings
When running benchmark/compare.js, it is typical to run a version of
node that does not support template strings. This provides backwards
compatibility for comparing benchmarks using older versions of node.

PR-URL: https://github.com/iojs/io.js/pull/714
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-02-04 03:53:22 -06:00
Brendan Ashworth
89dd8e062f benchmark: clean up common.js
This commit cleans up `benchmark/common.js` with a few generic changes
such as the following:

- declare all `require()`'d libraries at the top instead of in the
  middle
- add some empty whitespace where it helps readability
- changes ambiguous variable names
- standardizes most if / else blocks
- missing semicolons

PR-URL: https://github.com/iojs/io.js/pull/662
Reviewed-By: Nicu Micleușanu <micnic90@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2015-02-02 14:43:16 -08:00
Brendan Ashworth
083c421b5c benchmark: remove extra spacing in http options
This commit removes the benchmark spacing modification in
`client-request-body.js` and `end-vs-write-end.js` which adds two spaces
to the end of some variables to make sure the lines line up.

The reason behind this is that its totally pointless (the lines don't
actually line up with it) and it disallows you to parse the output with
a tool like awk, or at least makes it a lot harder.

PR-URL: https://github.com/iojs/io.js/pull/650
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-01-30 16:09:10 -05:00
Fishrock123
514b1d964b doc: add more info to benchmark/README.md
Adds info on the `wrk` prerequisite for http benchmarks and how to
run benchmarks with options.

PR-URL: https://github.com/iojs/io.js/pull/629
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-01-28 16:56:26 -05:00
Vladimir Kurchatkin
45d8d9f826 buffer: implement iterable interface
This makes possible to use `for..of` loop with
buffers. Also related `keys`, `values` and `entries`
methods are added for feature parity with `Uint8Array`.

PR-URL: https://github.com/iojs/io.js/pull/525
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-28 16:40:15 +03:00
Yosuke Furukawa
5d014637b6 benchmark: print score to five decimal places
PR-URL: https://github.com/iojs/io.js/pull/516
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-21 01:21:44 +01:00
Yosuke Furukawa
3abfb56f9b benchmark: fix tcp bench after internal api change
Fix up the tcp raw benchmarks after an internal API change.

PR-URL: https://github.com/iojs/io.js/pull/495
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-18 18:09:10 +01:00
Ben Noordhuis
50177fb13c benchmark: stop v8 benchmark clobbering RegExp
deps/v8/benchmarks/regexp.js clobbers the RegExp global, breaking
util.format() and console.log().  Unclobber it to keep the other
benchmarks working.

Fixes the following error when running benchmark/misc/v8-bench.js:

    $ out/Release/iojs benchmark/misc/v8-bench.js
    util.js:84
        if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
            ^
    TypeError: object is not a function
        at Object.exports.debuglog (util.js:84:9)
        at timers.js:12:29
        at NativeModule.compile (node.js:800:5)
        at NativeModule.require (node.js:769:18)
        at net.js:5:14
        at NativeModule.compile (node.js:800:5)
        at NativeModule.require (node.js:769:18)
        at tty.js:4:11
        at NativeModule.compile (node.js:800:5)
        at Function.NativeModule.require (node.js:769:18)

This could alternatively be addressed by caching the RegExp global
in lib/util.js.  That's not a bad approach and I considered it but
doing it for just RegExp and not other globals would be half-baked.

Maybe the more thorough approach where we cache all globals at
start-up is something for a follow-up pull request.

Fixes: https://github.com/iojs/io.js/pull/475
PR-URL: https://github.com/iojs/io.js/pull/489
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
2015-01-18 14:08:29 +01:00
Yosuke Furukawa
ea7750bddd benchmark: add filter option for benchmark
Before:

    # common.js executes all tests in net directory.
    $ ./iojs common.js net

After:

    # common.js executes only "dgram" tests in net directory.
    $ ./iojs common.js net dgram

PR-URL: https://github.com/iojs/io.js/pull/488
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-17 17:13:07 +01:00
Yosuke Furukawa
182c3b689c benchmark: fix command name in benchmark scripts
PR-URL: https://github.com/iojs/io.js/pull/410
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-14 02:29:59 +01:00
isaacs
3e1b1dd4a9 Remove excessive copyright/license boilerplate
The copyright and license notice is already in the LICENSE file.  There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Ben Noordhuis
aff56cd2b4 lib: micro-optimize url.resolve()
Replace the call to Array#splice() with a faster open-coded version
that creates less garbage.

Add a new benchmark to prove it.  With the change applied, it scores
about 5% higher and that is nothing to sneeze at.

PR-URL: https://github.com/iojs/io.js/pull/184
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 21:33:52 +01:00
Ben Noordhuis
6b2af5f0c7 benchmark: rename url.parse() benchmark
Rename the url.parse() benchmark from url.js to url-parse.js.
A follow-up commit is going to add another one for url.resolve().

PR-URL: https://github.com/iojs/io.js/pull/184
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 21:33:21 +01:00
Ben Noordhuis
d3f8db1244 lib: micro-optimize EventEmitter#removeListener()
Replace the call to Array#splice() with a faster open-coded version
that creates less garbage.

Add a new benchmark to prove it.  With the change applied, it scores
a whopping 40% higher.

PR-URL: https://github.com/iojs/io.js/pull/185
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 02:39:42 +01:00
Ben Noordhuis
d0c238cc81 benchmark: fix printing of large numbers
Don't use Number#toPrecision(), it switches to scientific notation for
numbers with more digits than the precision; use Number#toFixed().

PR-URL: https://github.com/iojs/io.js/pull/185
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-20 02:38:47 +01:00
Ben Noordhuis
1a63b45a2a benchmark: pre-optimize url.parse() before start
Force V8 to optimize url.parse() before starting the actual benchmark.
Tries to minimize variance between successive runs caused by the
optimizer kicking in at different points.

It does not seem to have much impact, CPU times are roughly the same
before and afterwards; url.parse() quickly plateaus at a local optimum
where most time is spent in V8 builtins, notably Runtime_StringSplit()
and Object::GetElementWithReceiver() calls originating from
deps/v8/src/uri.js, with no recurring optimize/deoptimize cycles that
I could spot.

Still, I don't see any downsides to pre-optimizing the function being
benchmarked so in it goes.

PR-URL: https://github.com/iojs/io.js/pull/132
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-12-19 23:10:31 +01:00
cjihrig
5678595856 fs: deprecate exists() and existsSync()
These methods don't follow standard conventions, and shouldn't
be used anyway.

Fixes: https://github.com/iojs/io.js/issues/103
PR-URL: https://github.com/iojs/io.js/pull/166
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-19 10:27:48 -05:00
micnic
8c69d7bed4 domain: forward args to .run(fn)
Adds the feature to define arguments for the function called in
domain.run(), this is supposed to be useful when a function is called from
another context and some values from the current context are needed as
arguments, it's similar to the callback from setTimeout or setInterval.

PR-URL: https://github.com/iojs/io.js/pull/15
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-12 12:14:11 +11:00
Ben Noordhuis
21a679a10f benchmark: add url benchmarks
Based on the ad-hoc benchmark from joyent/node#8638 plus an additional
benchmark for user:pass auth URLs.

PR-URL: https://github.com/iojs/io.js/pull/102
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-12-09 22:16:41 +01:00
Robert Kowalski
efa47e593d benchmark: add test for module loader
Adds a test for benchmarking the module loader, needed for benchmarking
changes / refacortings in the module loader.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-24 15:48:55 -07:00
Ben Noordhuis
8ae32a9864 bench: fix buffers/buffer-base64-encode benchmark
The test is supposed to measure the performance of the base64 encoder
so move the Buffer#write() calls out of the benchmark section.

The overhead of the calls isn't terrible (about 1-3%) but having
unrelated activity in a micro-benchmark is never a good idea.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-06-04 14:37:27 -07:00
Raymond Feng
329103540c doc: Add a README for benchmark tests
The README.md documents how to run node core benchmark tests and
how to write new tests.
2014-05-28 11:58:08 -07:00
Raymond Feng
4c672c8a5e benchmark: Add a test to measure Buffer.slice perf
Buffer.slice can be expensive. One regression was reported by https://github.com/joyent/node/issues/7633. The method should be benchmarked.
2014-05-28 11:57:05 -07:00
Sean McArthur
226f98a356 buffer: add compare and equals methods
compare() works like String.localeCompare such that:

    Buffer.compare(a, b) === a.compare(b);

equals() does a native check to see if two buffers are equal.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-28 22:09:48 -07:00
Nick Apperson
d4fcb23e38 buffer: improve {read,write}{U}Int* methods
Increase the performance and simplify the logic of Buffer#write{U}Int*
and Buffer#read{U}Int* methods by placing the byte manipulation code
directly inline.

Also improve the speed of buffer-write benchmarks by creating a new
call directly to each method by using Function() instead of calling by
buff[fn].

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-01 17:31:28 -07:00
Timothy J Fontaine
bfc823de90 benchmark: update to use new wrk 2014-02-25 11:28:46 -08:00
Fedor Indutny
9836a4eeda stream_wrap: use uv_try_write where possible
Use `uv_try_write` for string and buffer writes, thus avoiding to do
allocations and copying in some of the cases.
2014-01-29 02:49:03 +04:00
Fedor Indutny
f5ab3e4c5c benchmark: fixate ciphers in tls benchmarks
Benchmark should always use the same cipher in order to be truthful.
2013-12-07 02:32:03 +04:00
Jackson Tian
60958d235d benchmark: Correct the bufferSize to highWaterMark
The bufferSize has been removed. Use highWaterMark instead of.
2013-11-06 16:32:22 +04:00
Ben Noordhuis
df3537102b benchmark: add http chunked encoding benchmarks
Test both "Content-Length: xxx" and "Transfer-Encoding: chunked" responses in
the http/simple benchmark.
2013-11-01 15:44:44 +01:00
isaacs
2be09f9493 Merge remote-tracking branch 'ry/v0.10' 2013-08-31 17:58:44 -07:00
isaacs
00a1d3633c benchmark: Fix execArgv handling
Bug in 01f3b46 causes the same benchmark to be run repeatedly.

Not so useful for the compare scripts.
2013-08-31 17:58:17 -07:00
isaacs
cece100082 Merge remote-tracking branch 'ry/v0.10' 2013-08-31 11:29:51 -07:00
isaacs
01f3b468a9 benchmark: Support passing v8 flags to benchmarks
The better to test --use-strict effects on performance.

(Spoiler: it has no measurable effect on performance.)
2013-08-31 10:36:44 -07:00
Matthew Aynalem
c171c490f2 fixes #6031 spelling errors
explictly => explicitly
accesss => access
througput => throughput
epxression => expression
communiction => communication
becuase => because
repersent => represent
condonitions => conditions
decompresion => decompression
intentially => intentionally
eventes => events
listning => listening
resicved => received
becuase => because
fundimental => fundamental
colapse => collapse
privlages => privileges
sufficently => sufficiently
hapepns => happens
expliclitly => explicitly
thier => their
shold => should
2013-08-19 16:42:16 -07:00
Trevor Norris
9a29aa8c55 benchmark: update misc to new v8 API 2013-08-01 15:02:38 -07:00
Ben Noordhuis
d75f67f949 bench: fix up benchmarks after internal api change 2013-07-20 12:13:54 +02:00
Trevor Norris
22668db73d benchmark: update callbacks only receive data
Since the SlabAllocator was removed the buffer length/offset is no
longer sent to the onread callback. The benchmarks have been updated to
reflect that.
2013-07-08 16:53:41 -07:00
isaacs
ba048e72b0 Merge remote-tracking branch 'ry/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	configure
	deps/uv/ChangeLog
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/v8/src/isolate.cc
	deps/v8/src/version.cc
	lib/http.js
	src/node_version.h
2013-05-27 14:46:52 -07:00
Ben Noordhuis
fda2b319dc http: save roundtrips, convert buffers to strings
This commit adds an optimization to the HTTP client that makes it
possible to:

* Pack the headers and the first chunk of the request body into a
  single write().

* Pack the chunk header and the chunk itself into a single write().

Because only one write() system call is issued instead of several,
the chances of data ending up in a single TCP packet are phenomenally
higher: the benchmark with `type=buf size=32` jumps from 50 req/s to
7,500 req/s, a 150-fold increase.

This commit removes the check from e4b716ef that pushes binary encoded
strings into the slow path. The commit log mentions that:

    We were assuming that any string can be concatenated safely to
    CRLF.  However, for hex, base64, or binary encoded writes, this
    is not the case, and results in sending the incorrect response.

For hex and base64 strings that's certainly true but binary strings
are 'das Ding an sich': string.length is the same before and after
decoding.

Fixes #5528.
2013-05-23 02:13:26 +02:00
isaacs
61c9f78c63 Merge remote-tracking branch 'ry/v0.10' into master
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/ChangeLog
	deps/uv/config-unix.mk
	deps/uv/src/unix/stream.c
	deps/uv/src/version.c
	deps/uv/uv.gyp
	src/node.cc
	src/node_buffer.cc
	src/node_crypto.cc
	src/node_version.h
	src/stream_wrap.cc
	src/stream_wrap.h
2013-05-17 14:04:54 -07:00
isaacs
201baa273b benchmark: hash stream 2013-05-14 11:36:04 -07:00
Fedor Indutny
f2d5cea73a benchmark: add chunked-encoding benchmark 2013-04-27 21:03:40 +04:00
Ben Noordhuis
05bd6b7bcd bench: add child process read perf benchmark 2013-03-25 13:16:07 +01:00
Trevor Norris
31314b6978 bench: compare binaries equal times
The benchmark compare would drop the last run of the binary pairs. So
when they were only run once an error would arise because no data was
generated for the second binary.
2013-03-20 20:25:48 +01:00
Ben Noordhuis
3dac421393 bench: add dgram send/recv benchmark 2013-03-20 17:16:30 +01:00
isaacs
d62cf59dc1 http: Don't hot-path end() for large buffers
The benefits of the hot-path optimization below start to fall off when
the buffer size gets up near 128KB, because the cost of the copy is more
than the cost of the extra write() call.  Switch to the write/end method
at that point.

Heuristics and magic numbers are awful, but slow http responses are
worse.

Fix #4975
2013-03-14 08:04:59 -07:00
isaacs
e7b8bad3d9 bench: Do math on numbers in compare.js, not strings 2013-03-07 11:56:53 -08:00
isaacs
db5d58e842 bench: Use environ to run compares more than once
This will run the benchmarks the number of times specified by NODE_BENCH_RUNS,
to attempt to reduce variability.

If the number of runs is high enough, it'll also throw out the top and bottom
quartiles, since that's where the outliers will be.

It's not very fancy statistics-fu, but it's better than nothing.

Also, linted this file.  It had tabs in it.  TABS!
2013-03-06 12:33:05 -08:00
isaacs
e4383c0170 bench: Add flag to be silent in runner
This is helpful in tracking down bailouts and deopts in Stream classes,
without triggering one from the string write in console.log
2013-03-05 14:23:01 -08:00
isaacs
88befa6021 bench: Make http easier to profile
Do not run the http/simple.js server in a child process.

Fix #4831
2013-02-25 17:47:28 -08:00
isaacs
053e02ef8e benchmark: Fix alignment issues on --html compare output 2013-02-20 09:17:29 -08:00
isaacs
bd4d585b7a bench: Add bench-crypto 2013-02-19 17:16:55 -08:00
isaacs
4b80f217cd bench: Simplify duration arguments to benchmarks
For throughput benchmarks, run with just 5s durations rather than 1s and 3s.

For startup benchmark, run with just a single 1s duration, since it's very
consistent anyway.
2013-02-19 17:16:55 -08:00
isaacs
2ed56e5235 bench: Consistency in benchmark filenames 2013-02-19 17:16:55 -08:00
isaacs
06fbcca6bb bench: Remove _bench_timer (no loner used) 2013-02-19 17:16:55 -08:00
isaacs
ef08f0fbb1 bench: Use wrk for http benchmarking
Remove ab, since it's no longer used.
2013-02-19 17:16:29 -08:00
isaacs
035aa6b4ce bench: Show % change rather than % difference 2013-02-19 14:14:39 -08:00
isaacs
087c437961 bench: Add --html to compare script 2013-02-19 14:14:38 -08:00
isaacs
7658f4c29c bench: Fail gracefully if function_call binding fails 2013-02-19 14:14:38 -08:00
isaacs
7d51745827 bench: Remove old run script 2013-02-19 14:14:37 -08:00
isaacs
0a406869df bench: Replace tls-fragmentation with tls/throughput 2013-02-19 14:14:37 -08:00
isaacs
bafc51c0f9 bench: Move tls-connect into benchmark/tls
Also, make it work properly with current node.
2013-02-19 14:14:37 -08:00
isaacs
8c719f7c71 bench: Make io.c output easier to read 2013-02-19 14:14:37 -08:00
isaacs
8a3f52170e bench: Remove io.js
Better covered by the other benchmark/fs scripts.
2013-02-19 14:14:36 -08:00
isaacs
2a64edb025 bench: Add fs write stream throughput 2013-02-19 14:14:36 -08:00
isaacs
1fc6f99340 bench: Add read-stream throughput 2013-02-19 14:14:36 -08:00
isaacs
6d116be7cf bench: Move fs-readfile.js to fs/readfile.js 2013-02-19 14:14:35 -08:00
isaacs
844b33205c bench: Move v8_bench into misc 2013-02-19 14:14:35 -08:00
isaacs
2a2942bd7f bench: Move string_creation into misc 2013-02-19 14:14:35 -08:00
isaacs
fef35fc4f1 bench: Remove settimeout (Covered by misc/timeout.js) 2013-02-19 14:14:35 -08:00
isaacs
3761be3d99 bench: Move timers to misc/timers 2013-02-19 14:14:34 -08:00
isaacs
7e5cd08061 bench: move next-tick to misc/next-tick-breadth 2013-02-19 14:14:34 -08:00
isaacs
f7a4ccb409 bench: Move nexttick-2 to misc/next-tick-depth
x
2013-02-19 14:14:34 -08:00
isaacs
44be55fc4e bench: Move process_loop to misc/spawn-echo 2013-02-19 14:14:34 -08:00
isaacs
4e1bcdcab9 bench: Add function_call to bench-misc 2013-02-19 14:14:33 -08:00
isaacs
e87ed91fac bench: Arrays 2013-02-19 14:14:33 -08:00
isaacs
3f67a48dd4 bench: Add buffers/dataview_set 2013-02-19 14:14:33 -08:00
isaacs
56b22956ad bench: Remove unused 'fast_buffer2' benchmarks 2013-02-19 14:14:33 -08:00
isaacs
048f7fd37c bench: Merge fast_buffer_creation and buffer_creation 2013-02-19 14:14:32 -08:00
isaacs
55aa2571a0 bench: Buffer read/write benchmarks 2013-02-19 14:14:32 -08:00
isaacs
419607e8eb bench: Buffer creation 2013-02-19 14:14:32 -08:00
isaacs
cc38528acf bench: buffer-base64-encode 2013-02-19 14:14:32 -08:00
isaacs
921c3c2097 bench: misc/startup.js 2013-02-19 14:14:31 -08:00
isaacs
3b16657e77 bench: misc/url 2013-02-19 14:14:31 -08:00
isaacs
536ce44689 bench: http benchmarks
Also: make http_simple less chatty
2013-02-19 14:14:31 -08:00
isaacs
d5d04a51d6 bench: Remove client_latency
No one actually knows what this is supposed to be doing,
anyway.  It's not a good benchmark.
2013-02-19 14:14:31 -08:00
isaacs
051c1317f9 bench: Remove throughput (covered by benchmark/net) 2013-02-19 14:14:30 -08:00
isaacs
e82f97401f bench: net benchmarks using common script 2013-02-19 14:14:30 -08:00
isaacs
baea73ccda bench: Move net-pipe into benchmark/net 2013-02-19 14:14:30 -08:00
isaacs
aa2edd4b89 bench: A compare script for analyzing benchmarks 2013-02-19 14:14:30 -08:00
isaacs
37077de83d bench: add runner 2013-02-19 14:14:29 -08:00
isaacs
dd069a2539 bench: Add ab() method to common for http testing 2013-02-19 14:14:29 -08:00
isaacs
00e1962495 bench: Add common script 2013-02-19 14:14:29 -08:00
isaacs
8476aefc8e fs: Change default WriteStream config, increase perf
This increases fs.WriteStream throughput dramatically by removing the
"higher default water marks" for fs.WriteStream.

Also includes a benchmark.  Current performance is significantly higher
than v0.8 for strings at all tested levels except size=1.  Buffer
performance is still lackluster.

Further improvement in the stream.Writable base class is required, but
this is a start.
2013-02-15 18:48:43 -08:00
Ben Noordhuis
19d29aa0e8 bench: make io.c file path configurable 2013-02-12 19:38:29 +01:00
isaacs
ae6f4b32c4 benchmark: Add resume() in static_http_server 2013-01-17 14:54:59 -08:00
Trevor Norris
22b84e6216 buffer: floating point read/write improvements
Improvements:
* floating point operations are approx 4x's faster
* Now write quiet NaN's
* all read/write on floating point now done in C, so no more need for
  lib/buffer_ieee754.js
* float values have more accurate min/max value checks
* add additional benchmarks for buffers read/write
* created benchmark/_bench_timer.js which is a simple library that
  can be included into any benchmark and provides an intelligent tracker
  for sync and async tests
* add benchmarks for DataView set methods
* add checks and tests to make sure offset is greater than 0
2013-01-16 10:17:20 -08:00
isaacs
7550e31d1a benchmark: Make flamegraphs a bit more useful 2012-12-29 15:32:26 -08:00
isaacs
ecdde7df15 benchmark: Set port range properly on Linux 2012-12-29 15:32:26 -08:00
Ben Noordhuis
a329729537 buffer: speed up base64 encoding by 20%
Remove a lot of branches from the inner loop. Speeds up buf.toString('base64')
by about 20%.

Before:

  $ time out/Release/node benchmark/buffer-base64-encode.js
  real    0m6.607s
  user    0m5.508s
  sys     0m1.088s

After:

  $ time out/Release/node benchmark/buffer-base64-encode.js
  real    0m5.520s
  user    0m4.520s
  sys     0m0.992s
2012-12-28 13:20:07 +01:00
isaacs
ec7455558f benchmark: Set ephemeral ports properly on sunos 2012-12-21 00:07:35 +00:00
isaacs
825af451fb benchmark: Make http.sh more useful 2012-12-21 00:07:34 +00:00
isaacs
79ec9dc1dd benchmark: Support names in http-flamegraph 2012-12-21 00:07:34 +00:00
isaacs
836593da23 benchmark: Improve http-flamegraph 2012-12-21 00:07:34 +00:00
Ben Noordhuis
d1556fbdd2 bench: report stats in benchmark/net-pipe 2012-12-20 14:48:51 +01:00
Ben Noordhuis
79ae8b7ae2 Merge remote-tracking branch 'origin/v0.8' 2012-12-20 12:39:04 +01:00
Ben Noordhuis
ba407ce410 bench: use res.end() for chunked encoding
Use res.end() for the final chunk so we can benchmark the 'hot path' shortcut
in lib/http.js that packs the headers and the body into a single packet.
2012-12-20 11:44:10 +01:00
isaacs
43538f4f8f benchmark: Add http-flamegraph
This is very similar to http.sh, but generates a flamegraph
with dtrace, pruning off the single-hit stacks so that we can
more easily see the places where relevant amounts of time are
spent.
2012-12-18 11:56:53 -08:00
isaacs
7742257feb benchmark: Add once() function to net-pipe benchmark fixture 2012-12-14 10:52:29 -08:00
isaacs
3149d2f7dc benchmark: Add net-pipe benchmark
Just sends a buffer to a server, which echoes it back, and then measures
the Gbits/second.  Very similar to throughput.js, but using a single
process, so that it's possible to dtrace and get the jsstack frames for
profile comparison.
2012-11-30 18:26:18 -08:00
isaacs
e2bcff9aa7 bench: Use hrtime in throughput benchmark 2012-11-11 10:02:33 -08:00
Ben Noordhuis
2c97da82f5 bench: correct time calculation in url.js 2012-09-13 14:02:22 +02:00
Ben Noordhuis
10ba95c11a bench: improve url parser benchmark 2012-09-13 01:21:54 +02:00
Felix Böhm
f5c68b280f bench: add url parser benchmark 2012-09-13 01:21:53 +02:00
jbergstroem
8eccc417a7 bench: fetch port from env
http_simple.js honors $PORT, http_simple_bench.sh should too.
2012-08-13 18:52:06 +02:00
Bert Belder
23dc099299 benchmark: add single process tls connection benchmark 2012-07-14 01:43:34 +02:00
Bert Belder
d2e40f66cc Merge branch 'v0.6' into v0.8 2012-07-12 03:30:04 +02:00
isaacs
8a946c2ee7 benchmark: Backport improvements made in master
Ported to v0.6 for easier comparison in the 0.8.0 blog post.
2012-06-23 10:03:12 -07:00
Bert Belder
6e5217d320 Fix bug in io benchmark 2012-06-21 20:52:38 +02:00
Ben Noordhuis
5ff2ae8389 bench: start a worker for each CPU 2012-05-25 00:35:10 +02:00
Ben Noordhuis
7535e3930a bench: add http_simple_auto benchmark
Starts a server and benchmarks it with ab.
2012-05-25 00:35:07 +02:00
isaacs
ee6c11876a benchmark for fs.readfile 2012-05-16 20:04:44 -07:00
Bert Belder
4ddafbd563 Benchmark: add /unicode/nnn bench to http_simple.js 2012-05-09 03:56:09 +02:00
Bert Belder
7f68f256cf Benchmark: clean up http_simple.js 2012-05-09 03:56:07 +02:00
Ben Noordhuis
12a90e98bf bench: add continuous stress test
Useful in tracking down or at least demonstrating memory leaks.
2012-04-27 23:11:32 +02:00
Ben Noordhuis
4e84dfa683 bench: run GC and dump stats if --expose-gc is set 2012-04-27 20:38:58 +02:00
isaacs
45c1d4f96f Add switches to http_simple bench to use domains 2012-04-17 13:14:55 -07:00
Ben Noordhuis
11770bf5e2 test: move pummel/test-tls-fragmentation to benchmark/
Said test takes over 90 seconds on my Core 2 Duo which is too long, even for
the pummel tests.
2012-03-29 17:25:37 +02:00
Bert Belder
408f450286 client latency benchmark: don't require('request') 2012-03-07 04:52:29 +01:00
isaacs
150053b3fa Typo in http_server_lag.js script
Thanks, @mscdex
2012-03-06 19:31:16 -08:00
isaacs
fb53986a80 Bash script for running http-simple benchmarks 2012-03-06 18:19:17 -08:00
isaacs
17da4242b0 A server with configurable lag for testing 2012-03-06 18:19:17 -08:00
isaacs
d5fca08da4 A benchmark script for measuring client latency 2012-03-06 18:19:17 -08:00
Ben Noordhuis
544e5ee1fb bench: add http_simple_auto benchmark
Starts a server and benchmarks it with ab.
2012-03-06 18:11:53 +01:00
Ben Noordhuis
8b2abed03d bench: add /echo endpoint to http_simple
Copies the POST request data verbatim into the response body.
2011-12-30 02:03:10 +01:00
Ben Noordhuis
ed5bad754c bench: fix use of fd after close 2011-12-26 03:23:34 +01:00
Bert Belder
c6347dcfb4 Add another nextTick benchmark
It tests how many iterations the event loop can make per second.
2011-12-23 03:09:36 +01:00
Ben Noordhuis
78ca555845 bench: optimize io.c benchmark
Use static buffers. Most clock ticks were spent in malloc() and free() instead
of read() and write().

Fix measurements. Really fast runs would result in bogus results like:

  Wrote 1048576000 bytes in -0.731630s using 8192 byte buffers: -1366.811093mB/s
2011-11-10 21:13:37 +01:00
Ben Noordhuis
4fc0fdc6ee bench: start (NUM_CPUS-1) workers
The master is a worker too so fork off one less worker.
2011-11-09 17:34:53 +01:00
koichik
1001cf412c bench: update static_http_server benchmark to new API
Fixes #2016.
2011-11-06 01:25:07 +09:00
Ben Noordhuis
89014c9d40 bench: add http_simple cluster edition benchmark 2011-11-04 23:53:01 +01:00
Ben Noordhuis
5fee1ff7bc bench: add process.nextTick() benchmark 2011-10-31 22:02:46 +01:00
Ryan Dahl
16e1d5b5ce Remove uname and git-rev detection from http_simple.js 2011-10-12 12:29:40 -07:00
Ryan Dahl
2b46959075 Add throughput benchmark 2011-10-11 22:40:04 -07:00
Ryan Dahl
f018be3b5f Print libuv counters after http_simple exits 2011-10-06 15:02:27 -07:00
Ben Noordhuis
63607a0304 bench: make number of response body chunks configurable in http_simple 2011-08-17 23:26:23 +02:00
Ben Noordhuis
d72c6940f8 bench: make http_simple send chunked encoding if requested 2011-08-17 20:39:20 +02:00
Ben Noordhuis
4726504663 typed arrays: preliminary benchmarks 2011-08-12 18:42:24 +02:00
Ryan Dahl
1fce3f0ef8 Add startup memory script to benchmarks 2011-02-18 14:01:04 -08:00
Ryan Dahl
bd094103d7 Add script for running V8 benchmarks 2011-02-14 17:26:54 -08:00
Ryan Dahl
320a56b89d Bump size of bench histogram to 100ms 2011-01-10 18:00:21 -08:00
Ryan Dahl
08bec7ab0a Remove debugger statement from http_simple.js
results in slow bench
2011-01-06 18:07:50 -08:00
Ryan Dahl
62e0ca05a6 debugger: Disable/Enable raw mode for child 2010-12-30 15:46:47 -08:00
Ryan Dahl
73cfda12bb Abstract out a Server.prototype.pause method 2010-10-28 11:42:22 -07:00
Ryan Dahl
ad61d77fa3 Abstract out net.Server.prototype._rejectPending
Does the same timeout action for maxConnections as it does for EMFILE.
2010-10-28 11:33:35 -07:00
Ryan Dahl
38dde9684f Add extra anti-DoS tech to net.Server 2010-10-27 12:09:16 -07:00
Ryan Dahl
aeb9bed63e Improve idle benchmarks 2010-10-27 02:52:49 -07:00
Ryan Dahl
ac54272218 Gracefully handle EMFILE
Implementing a tip from Marc Lehmann:
http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#The_special_problem_of_accept_ing_wh

Keep an extra FD around for every server. When you hit EMFILE, destroy that
FD, accept a connection, close it; in this way you can clear the connection
queue and let people know that you're overload.

No more timeout needed.
2010-10-27 02:12:25 -07:00
Ryan Dahl
bc47353bbe Use the timer list for setTimeout 2010-10-26 14:53:18 -07:00
Ryan Dahl
33e45bbe46 Add incomplete R plot file 2010-10-20 21:28:49 -07:00
Ryan Dahl
a313f38c34 use bash instead of sh in http_simple_bench.sh 2010-10-18 17:48:49 -07:00
Ryan Dahl
3cf4827ae0 Add idle connection test 2010-10-15 12:11:50 -05:00
Ryan Dahl
ff456b3886 Add 'make bench' script 2010-10-13 16:20:24 -07:00
Ryan Dahl
cdde22a27d Improve benchmark/http_simple.js 2010-10-13 14:30:50 -07:00
Micheil Smith
e38eb0c5a4 Soft migration of sys -> util, Removal of deprecated utils module. 2010-10-11 15:21:36 -07:00
Ryan Dahl
f9d6b074cf output time of function calls 2010-09-28 01:14:38 -07:00
Ryan Dahl
353e2565d5 Fix timing on I/O benchmark 2010-09-25 18:19:50 +02:00
Ryan Dahl
3fc9192d0d Add function_call benchmark 2010-09-23 22:27:44 -07:00
Ryan Dahl
7628905a9b Don't use empty.js - breaks module test 2010-09-09 16:22:57 -07:00
Felix Geisendörfer
f870240dcf Simple benchmark for node's startup time 2010-09-09 15:51:17 -07:00
Ryan Dahl
ff027d571b Update fast buffer benchmarks 2010-09-09 11:03:50 -07:00
Ryan Dahl
488aff085b Improve appendix markdown 2010-08-21 01:24:14 -07:00
Ryan Dahl
12a169e8ff Add buffer_creation benchmark 2010-08-19 01:40:28 -07:00
Ryan Dahl
41ad33910f Add Paul Querna's io benchmarks 2010-08-17 08:43:26 -07:00
Blake Mizerany
8c8534046c fix whitespace errors 2010-06-29 23:59:24 -07:00
Ryan Dahl
444b33584d Remove switch-replace residue 2010-06-24 09:37:36 -07:00
Ryan Dahl
ba792ea202 :%s/sys.puts/console.log/g
and there was much rejoicing
2010-06-23 20:05:29 -07:00
Ryan Dahl
ab723d022d Add buffer response to http_simple.js 2010-05-04 22:35:55 -07:00
Ryan Dahl
99984772df Allow different ports for http_simple.js 2010-05-02 17:26:18 -07:00
Ryan Dahl
ac3bc2ed41 Simplify GC idle notification
In particular, don't leave the timeout running when the heap is fully
compacted.
2010-04-15 01:30:58 -07:00
Ryan Dahl
b36f11d7b5 Set old/new from benchmark script args 2010-04-09 10:42:20 -07:00
Ryan Dahl
50c70ac714 Update stream API: forceClose() -> destroy(), close() -> end() 2010-04-08 12:24:29 -07:00
Ryan Dahl
62277ab79b Support both old and new HTTP closing APIs in benchmark program 2010-04-08 01:00:35 -07:00
Ryan Dahl
0281e1acf6 Fix benchmark script for testing both old and new version 2010-04-07 16:19:50 -07:00
Ryan Dahl
1b758ef268 Allow stream to write on close 2010-04-05 16:50:05 -07:00
arlolra
6f84063a3b Migrates benchmarks to the new api. 2010-03-23 08:13:17 -07:00
Ryan Dahl
b80f6e9ed1 http2 now default 2010-03-19 19:52:09 -07:00
Ryan Dahl
1762abcece http2 now passes all tests 2010-03-18 15:49:42 -07:00
Ryan Dahl
b07f2e25f4 Update http2 for new stream API 2010-03-09 12:00:06 -08:00
Ryan Dahl
fb6dc11f11 Clean up some things in the benchmarks 2010-03-08 19:06:25 -08:00
Ryan Dahl
04999ef969 Remove -Werror from deps/v8/SConstruct
-_-
2010-03-08 18:04:59 -08:00
isaacs
c488e5775a Remove process.mixin dependencies from benchmark scripts 2010-03-08 17:57:38 -08:00
Ryan Dahl
6d60d2db00 Revert "Use kqueue on macintosh"
Experiencing bugs http://github.com/ry/node/issues/#issue/74

This reverts commit 409020a67d.
2010-03-05 14:36:13 -08:00
Ryan Dahl
409020a67d Use kqueue on macintosh 2010-03-04 10:02:41 -08:00
Benjamin Thomas
b1b84960ce Rename writeHeader to writeHead 2010-02-25 13:01:21 -08:00
Ryan Dahl
12d78cd1df Rename sendHeader to writeHeader; allow reasonPhrase 2010-02-21 16:53:49 -08:00
Ryan Dahl
7c1c89fc29 Update benchmark script to new API 2010-02-17 15:37:12 -08:00
Ryan Dahl
ae85d9af97 API: Make request/response object closer to stream interface
- sendBody() renamed to write()
- 'body' event renamed to 'data'
- 'complete' event renamed to 'end'
2010-02-16 22:16:29 -08:00
Ryan Dahl
8e0dad4a27 Update http benchmark script to new url api. 2010-01-10 23:00:58 -08:00
Christopher Lenz
f8ba9c3bc9 Add http.Client.prototype.request()
Change the http.Client API so that it provides a single request() method
taking an optional parameter to specify the HTTP method (defaulting to
"GET"), instead of the five methods get(), head(), post(), del() and put().
2009-12-06 18:36:32 +01:00
Ryan Dahl
54c8ea5ea2 Fix http_simple server for new API 2009-11-06 12:53:27 +01:00
Ryan Dahl
d582599c14 Upgrade benchmark scripts for new module API 2009-10-31 20:06:46 +01:00
Ryan Dahl
ad0a4cefb8 Namespace EVERYTHING under process; introduce GLOBAL
http://groups.google.com/group/nodejs/browse_thread/thread/1034fd2ad2cd93e8
2009-10-29 23:36:41 +01:00
Ryan Dahl
04e53cab90 Rename node.libraryPaths to require.paths
to be more inline with CommonJS.
2009-10-25 22:51:57 +01:00
Ryan Dahl
1a2762b78e Update benchmarks with new createChildProcess API 2009-10-07 10:24:50 +02:00
Ryan Dahl
8185e1fd25 Remove include() add node.mixin()
include() should not be used by libraries because it will pollute the global
namespace. To discourage this behavior and bring Node more in-line with
the current CommonJS module system, include() is removed.

Small scripts like unit tests often times do want to pollute the global
namespace for ease. To avoid the boiler plate code of

  var x = require("/x.js");
  var foo = x.foo;
  var bar = x.bar;

The function node.mixin() is stolen from jQuery's jQuery.extend. So that it
can be written:

  node.mixin(require("/x.js"));

Reference:
http://docs.jquery.com/Utilities/jQuery.extend
http://groups.google.com/group/nodejs/browse_thread/thread/f9ac83e5c11e7e87
2009-10-05 15:46:31 +02:00
Ryan Dahl
23c7f472d0 API: Move node.exit() to process.exit(). 2009-09-28 18:48:18 +02:00
Ryan Dahl
f6657c3c9d Move http library to /http.js 2009-09-28 12:36:36 +02:00
Ryan
ad9d683f9f API: rename node.Process to node.ChildProcess
This is to avoid confusion with the global "process" object, especially for
the instances of node.Process.
2009-08-26 22:36:45 +02:00
Ryan
316e2833f0 Use flat object instead of array-of-arrays for HTTP headers.
E.G. { "Content-Length": 10, "Content-Type": "text/html" } instead of
[["Content-Length", 10], ["Content-Type", "text/html"]].
The main reason for this change is object-creation efficiency.

This still needs testing and some further changes (like when receiving
multiple header lines with the same field-name, they are concatenated with a
comma but some headers ("Content-Length") should not be concatenated ; the
new header line should replace the old value).

Various thoughts on this subject:
http://groups.google.com/group/nodejs/browse_thread/thread/9a67bb32706d9efc#
http://four.livejournal.com/979640.html
http://mail.gnome.org/archives/libsoup-list/2009-March/msg00015.html
2009-08-23 12:32:49 +02:00
Ryan
65ec2d5db4 Fix http benchmark. Wasn't correctly dispatching. 2009-08-08 21:51:28 +02:00
Ryan
05d6319fa0 Add benchmark scripts.
To use the benchmarks:

  node benchmarks/run.js

or:

  make benchmark

The numbers reported are the elapsed milliseconds the script took to
complete. Currently only benching HTTP code and timers.
2009-07-13 16:38:55 +02:00
Ryan
70fe920fb5 Use events for all HTTP messages.
This is a rather large refactor! Mostly for the better side. I've had to
remove some functionality like req.interrupt(). A lot of other work is left
messy or incomplete.
2009-06-28 19:08:26 +02:00
Ryan
61fcbb1cd6 Add benchmark dir with ruby script 2009-06-18 14:36:30 +02:00