http: replace superfluous property with getter/setter by ronag · Pull Request #29015 · nodejs/node

Conversation

@ronag

Slightly reduces memory overhead by replacing superfluous property with getter/setter.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@ronag ronag changed the title http: replace duplicate property with getter/setter http: replace superfluous property with getter/setter

Aug 6, 2019

addaleax

@mscdex

AFAIK getters/setters like this incur noticeable overhead, so perhaps we should be adjusting the documentation to more strongly recommend socket over connection.

@mscdex

Also if we're making this change we should also replace all usage of .connection in core with .socket to avoid the overhead.

@ronag

trivikr

jasnell

@jasnell jasnell added deprecations

Issues and PRs related to deprecations.

semver-major

PRs that contain breaking changes and should be released in the next major version.

labels

Aug 7, 2019

trivikr

lpinca

@ronag

@nodejs-github-bot

Trott

@Trott

This was referenced

Jan 20, 2021

This was referenced

Sep 5, 2021

Labels

deprecations

Issues and PRs related to deprecations.

http

Issues or PRs related to the http subsystem.

semver-major

PRs that contain breaking changes and should be released in the next major version.