Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Conversation

indutny
Copy link
Member

@indutny indutny commented Jun 8, 2013

WIP, doesn't work with concurrent connections (for some yet unknown reason).

Usage example: https://gist.github.com/indutny/f60d9724b0513de242ec

/cc @bnoordhuis @isaacs

@Nodejs-Jenkins
Copy link

Thank you for contributing this pull request! Here are a few pointers to make sure your submission will be considered for inclusion.

Commit indutny/node@304a0a3 has the following error(s):

  • Commit message must indicate the subsystem this commit changes

Commit indutny/node@67be8ed has the following error(s):

  • Commit message must indicate the subsystem this commit changes

Commit indutny/node@2f3c21b has the following error(s):

  • Commit message must indicate the subsystem this commit changes

You can fix all these things without opening another issue.

Please see CONTRIBUTING.md for more information

@indutny
Copy link
Member Author

indutny commented Jun 8, 2013

Ok, fixed parallel requests error.

@indutny
Copy link
Member Author

indutny commented Jun 8, 2013

Surprisingly it seems to be almost 2x faster than tls module on my MBP: 840 rps vs 449 rps.

NOTE: comparing this scripts https://gist.github.com/indutny/b9913c3e2c99a20bbece

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/amout/amount/

@bnoordhuis
Copy link
Member

I like where this is going, Fedor.

@indutny
Copy link
Member Author

indutny commented Jun 9, 2013

src/node_wrap.h Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with style?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, space.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not your code but casting away return values is so very '80s.

@indutny
Copy link
Member Author

indutny commented Jun 14, 2013

Whoa, this took really long time to get this working properly... I invite you (@bnoordhuis and @isaacs, probably others) to review it once again before merging this into master!

@indutny
Copy link
Member Author

indutny commented Jun 14, 2013

And here are promising benchmark results (4 runs on osx):

tls/throughput.js dur=5 type=buf size=2: ./node-tls-wrap: 1.2469 ./node: 0.77893 ...... 60.07%
tls/throughput.js dur=5 type=buf size=1024: ./node-tls-wrap: 256.62 ./node: 189.25 .... 35.60%
tls/throughput.js dur=5 type=buf size=1048576: ./node-tls-wrap: 316.12 ./node: 329.04 . -3.93%
tls/throughput.js dur=5 type=asc size=2: ./node-tls-wrap: 1.2086 ./node: 0.67809 ...... 78.24%
tls/throughput.js dur=5 type=asc size=1024: ./node-tls-wrap: 240.74 ./node: 161.87 .... 48.73%
tls/throughput.js dur=5 type=asc size=1048576: ./node-tls-wrap: 306.87 ./node: 302.1 ... 1.58%
tls/throughput.js dur=5 type=utf size=2: ./node-tls-wrap: 1.2178 ./node: 0.66881 ...... 82.08%
tls/throughput.js dur=5 type=utf size=1024: ./node-tls-wrap: 249.63 ./node: 154.41 .... 61.66%
tls/throughput.js dur=5 type=utf size=1048576: ./node-tls-wrap: 288.85 ./node: 290.64 . -0.62%
tls/tls-connect.js concurrency=1 dur=5: ./node-tls-wrap: 434.57 ./node: 282.75 ........ 53.70%
tls/tls-connect.js concurrency=10 dur=5: ./node-tls-wrap: 467.16 ./node: 304.56 ....... 53.39%

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge with regexpEscape() from lib/repl.js? You probably want to move it to lib/util.js.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, will do it after merge in a separate commit.

indutny added 7 commits June 15, 2013 21:43
Originally contributed by @tjfontaine, but modified to be faster and
more generic.
StreamWrapCallbacks is a helper class for incepting into uv_stream_t*
management process.
Split `tls.js` into `_tls_legacy.js`, containing legacy
`createSecurePair` API, and `_tls_wrap.js` containing new code based on
`tls_wrap` binding.

Remove tests that are no longer useful/valid.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 or 1? That rather subverts the meaning of the .writeQueueSize property, doesn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I will just set it to 1 in javascript, its needed to make code work with net.js.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then .writeQueueSize should be changed to something like .hasPendingWrites=true|false.

@bnoordhuis
Copy link
Member

A few more comments but mostly LGTM.

@isaacs
Copy link

isaacs commented Jun 17, 2013

I like how the API is a lot simpler for users to interact with, and most of the code looks good. But we have to figure out sessions before this is shippable, I think.

@indutny
Copy link
Member Author

indutny commented Jun 17, 2013

Thanks, landed in dc50f27, af80e7b, 03e008d, 4c48a39, 6978e99, 0495b70, 5dd155a, 4536b27 and 56d9c48.

@indutny indutny closed this Jun 17, 2013
@indutny indutny deleted the feature/tls-wrap branch June 17, 2013 10:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants