Conversation
Most of the inlines were leftovers from a much older design iteration and are largely pointless or counter productive.
Use of a MaybeStackBuffer was just silly. Fix a long standing todo Reduce code duplication a bit.
src/node_http2.cc
Outdated
| }; | ||
| session->MakeCallback(env->error_string(), arraysize(argv), argv); | ||
| Local<Value> argv = Integer::New(isolate, lib_error_code); | ||
| session->MakeCallback(env->error_string(), 1, &argv); |
There was a problem hiding this comment.
You may want to call this arg, since it’s not really a vector any longer :)
(ditto below)
| // frame. This can be used, for instance, to create the Base64-encoded | ||
| // content of an Http2-Settings header field. | ||
| inline Local<Value> Http2Session::Http2Settings::Pack() { | ||
| Local<Value> Http2Session::Http2Settings::Pack() { |
There was a problem hiding this comment.
is it ok to remove this inline directive here and in the other functions? Wouldn't this impact perf somehow?
There was a problem hiding this comment.
@mcollina It’s not only okay, it’s more or less the correct thing to do.
This has a pretty good explanation. tl;dr: Compilers are generally better than humans at judging what functions to inline or not, and will gladly ignore this advice. However, inline does affect the linkage properties of a function, and so its primary use should be to mark functions that are defined in header files (outside of a class definition).
I just tested it with gcc, and the compiler output is the same before and after this commit, byte-for-byte.
Most of the inlines were leftovers from a much older design iteration and are largely pointless or counter productive. PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Use of a MaybeStackBuffer was just silly. Fix a long standing todo Reduce code duplication a bit. PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Most of the inlines were leftovers from a much older design iteration and are largely pointless or counter productive. PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Use of a MaybeStackBuffer was just silly. Fix a long standing todo Reduce code duplication a bit. PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Most of the inlines were leftovers from a much older design iteration and are largely pointless or counter productive. PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Use of a MaybeStackBuffer was just silly. Fix a long standing todo Reduce code duplication a bit. PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: #19400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
|
@jasnell could you backport this to |
/cc @addaleax @mcollina
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes