Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: improve JS Array creation from C++ #25288

Closed
wants to merge 2 commits into from

Conversation

@addaleax
Copy link
Member

commented Dec 31, 2018

src: improve ToV8Value() functions

  • Cache the isolate value between calls
  • Introduce an overload for dealing with integers/numbers
  • Use the vectored v8::Array::New constructor + MaybeStackBuffer
    for faster array creation

src: simplify JS Array creation

Use ToV8Value() where appropriate to reduce duplication
and avoid extra Array::Set() calls.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
addaleax added 2 commits Dec 30, 2018
src: improve ToV8Value() functions
- Cache the `isolate` value between calls
- Introduce an overload for dealing with integers/numbers
- Use the vectored `v8::Array::New` constructor + `MaybeStackBuffer`
  for faster array creation
src: simplify JS Array creation
Use `ToV8Value()` where appropriate to reduce duplication
and avoid extra `Array::Set()` calls.
@addaleax

This comment has been minimized.

Copy link
Member Author

commented Dec 31, 2018

@addaleax

This comment has been minimized.

Copy link
Member Author

commented Jan 1, 2019

@jasnell
jasnell approved these changes Jan 1, 2019
@addaleax

This comment has been minimized.

Copy link
Member Author

commented Jan 2, 2019

Landed in 112ee2a, 0ff1eb8

@addaleax addaleax closed this Jan 2, 2019

@addaleax addaleax deleted the addaleax:better-array-creation branch Jan 2, 2019

addaleax added a commit that referenced this pull request Jan 2, 2019
src: improve ToV8Value() functions
- Cache the `isolate` value between calls
- Introduce an overload for dealing with integers/numbers
- Use the vectored `v8::Array::New` constructor + `MaybeStackBuffer`
  for faster array creation

PR-URL: #25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jan 2, 2019
src: simplify JS Array creation
Use `ToV8Value()` where appropriate to reduce duplication
and avoid extra `Array::Set()` calls.

PR-URL: #25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jan 5, 2019
src: improve ToV8Value() functions
- Cache the `isolate` value between calls
- Introduce an overload for dealing with integers/numbers
- Use the vectored `v8::Array::New` constructor + `MaybeStackBuffer`
  for faster array creation

PR-URL: #25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax

This comment has been minimized.

Copy link
Member Author

commented Jan 5, 2019

Adding the backport-requested label, but ideally #25066 should be backported first.

@BridgeAR BridgeAR added this to Backport requested in v11.x Jan 10, 2019

refack added a commit to refack/node that referenced this pull request Jan 14, 2019
src: improve ToV8Value() functions
- Cache the `isolate` value between calls
- Introduce an overload for dealing with integers/numbers
- Use the vectored `v8::Array::New` constructor + `MaybeStackBuffer`
  for faster array creation

PR-URL: nodejs#25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
refack added a commit to refack/node that referenced this pull request Jan 14, 2019
src: simplify JS Array creation
Use `ToV8Value()` where appropriate to reduce duplication
and avoid extra `Array::Set()` calls.

PR-URL: nodejs#25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jan 14, 2019
src: simplify JS Array creation
Use `ToV8Value()` where appropriate to reduce duplication
and avoid extra `Array::Set()` calls.

PR-URL: #25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax

This comment has been minimized.

Copy link
Member Author

commented Jan 14, 2019

This applies cleanly now.

@BridgeAR BridgeAR moved this from Backport requested to Backported in v11.x Jan 14, 2019

@BridgeAR BridgeAR referenced this pull request Jan 16, 2019
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
src: improve ToV8Value() functions
- Cache the `isolate` value between calls
- Introduce an overload for dealing with integers/numbers
- Use the vectored `v8::Array::New` constructor + `MaybeStackBuffer`
  for faster array creation

PR-URL: nodejs#25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
src: simplify JS Array creation
Use `ToV8Value()` where appropriate to reduce duplication
and avoid extra `Array::Set()` calls.

PR-URL: nodejs#25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins referenced this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
6 participants
You can’t perform that action at this time.