Use flat object instead of array-of-arrays for HTTP headers.
authorRyan <ry@tinyclouds.org>
Sun, 23 Aug 2009 10:20:25 +0000 (12:20 +0200)
committerRyan <ry@tinyclouds.org>
Sun, 23 Aug 2009 10:32:49 +0000 (12:32 +0200)
commit316e2833f017150d58392f5ee82d86438ec22d5f
tree8499a41e8ecc6275cf291263665c2faca3734754
parent9c97b1db3099d61cd292aa59ec2227a619f3a7ab
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
benchmark/http_simple.js
benchmark/static_http_server.js
src/http.js
test/mjsunit/disabled/test-http-stress.js
test/mjsunit/test-http-client-race.js
test/mjsunit/test-http-client-upload.js
test/mjsunit/test-http-proxy.js
test/mjsunit/test-http-server.js
test/mjsunit/test-http.js
website/api.txt
website/index.html