Skip to content

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

Closed
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:better-array-creation
Closed

src: improve JS Array creation from C++#25288
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:better-array-creation

Conversation

@addaleax

Copy link
Copy Markdown
Member

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

- 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
Use `ToV8Value()` where appropriate to reduce duplication
and avoid extra `Array::Set()` calls.
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Dec 31, 2018
@addaleax

Copy link
Copy Markdown
MemberAuthor

@addaleax

Copy link
Copy Markdown
MemberAuthor

@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 1, 2019
@addaleax

Copy link
Copy Markdown
MemberAuthor

Landed in 112ee2a, 0ff1eb8

@addaleaxaddaleax closed this Jan 2, 2019
@addaleax
addaleax deleted the better-array-creation branch January 2, 2019 13:52
addaleax added a commit that referenced this pull request Jan 2, 2019
- 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
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
- 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

Copy link
Copy Markdown
MemberAuthor

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

refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
- 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 pushed a commit to refack/node that referenced this pull request Jan 14, 2019
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
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

Copy link
Copy Markdown
MemberAuthor

This applies cleanly now.

@BridgeARBridgeAR mentioned this pull request Jan 16, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
- 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 pushed a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
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>
@MylesBorinsMylesBorins mentioned this pull request Jan 24, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@addaleax@nodejs-github-bot@jasnell@cjihrig@joyeecheung@devsnek@BridgeAR