GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: add benchmark for coverage by bcoe · Pull Request #36972 · nodejs/node

Conversation

@bcoe

@bcoe bcoe commented Jan 17, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Working on #36956, I became a bit worried that as we extend code coverage to support more types of branching, performance might start to become unacceptable.

I created this benchmark to experiment:

Node 14.15.4, NODE_V8_COVERAGE, vs., no coverage:

process/coverage.js n=100000 *** -18.94 % ±0.77% ±1.02% ±1.30%

Node 15.6.0, NODE_V8_COVERAGE, vs., no coverage:

process/coverage.js n=100000 *** -17.95 % ±1.08% ±1.43% ±1.83%

Coverage with #36956, vs., no coverage:

process/coverage.js n=100000 *** -19.37 % ±1.36% ±1.79% ±2.30%

To Summarize

In the current release of 14/15, we see that running Node with coverage decreases performance by about 18%.

With the introduction of optional chaining in this benchmark, we see a 1 - 2% additional hit to performance.

Other interesting facts

  • I benchmarked coverage.js using Istanbul, vs., NODE_V8_COVERAGE, it was 37.46% slower than no coverage.
  • I benchmarked deps: V8: cherry-pick fe191e8d05cc #36956 with no coverage, vs., 15.6.0 with no coverage; there did not appear to be a significant difference in performance (0.37 % ±1.14% ±1.50% ±1.92%).

Conclusions

  • My gut is that it's worth taking the 1 - 2% performance hit to support a new type of branching in our coverage reporting.
  • As new constructs like this are added to JavaScript, we need to be mindful that the cost of branch coverage will continue to increase.
  • I was excited to see that v8's coverage offers a significant performance benefit over pre-instrumenting the JavaScript code.

CC: @schuay

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jaydenseric reacted with eyes emoji
All reactions
  • 👀 1 reaction
@bcoe
bcoe requested review from Trott, devsnek and targos January 17, 2021 03:43
@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to Node.js benchmarks and benchmarking infrastructure. process Issues and PRs related to the process subsystem. labels Jan 17, 2021
@bcoe

bcoe commented Jan 17, 2021

Copy link
Copy Markdown
Contributor Author

@joyeecheung I was thinking this benchmark would be a really good use of v8.startCoverage, because it would let us turn on coverage collection programmatically, at which point it would be easier to use this benchmark to detect regressions in coverage performance in the future.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott
Trott reviewed Jan 17, 2021
View reviewed changes
Comment thread benchmark/process/coverage.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Trott
Trott approved these changes Jan 17, 2021
View reviewed changes
@Trott

Trott commented Jan 17, 2021

Copy link
Copy Markdown
Member

Subsystem in commit message should be benchmark rather than test.

RaisinTen and benjamingr reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

benjamingr
benjamingr approved these changes Jan 18, 2021
View reviewed changes
@bcoe
bcoe force-pushed the benchmark-coverage branch from d206807 to 1d8a88b Compare January 18, 2021 18:57
@bcoe bcoe changed the title test: add benchmark for coverage benchmark: add benchmark for coverage Jan 18, 2021
@bcoe
bcoe force-pushed the benchmark-coverage branch 2 times, most recently from c5507d4 to b5eadb0 Compare January 18, 2021 19:03
jasnell
jasnell approved these changes Jan 18, 2021
View reviewed changes
@bcoe
bcoe force-pushed the benchmark-coverage branch from b5eadb0 to efea2d6 Compare January 18, 2021 19:16
@bcoe

bcoe commented Jan 18, 2021

Copy link
Copy Markdown
Contributor Author

@Trott refactored so that the benchmark is easier to use, it now spawns a subprocess with coverage enabled (_so no need to create a separate bin) 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Jan 18, 2021

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/35626/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joyeecheung
joyeecheung approved these changes Jan 19, 2021
View reviewed changes
Comment thread benchmark/process/coverage.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bcoe
bcoe force-pushed the benchmark-coverage branch from efea2d6 to ed4e294 Compare January 19, 2021 17:23
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@bcoe
bcoe force-pushed the benchmark-coverage branch from ed4e294 to 682f4e9 Compare January 22, 2021 17:17
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@bcoe
bcoe force-pushed the benchmark-coverage branch from 682f4e9 to ae141a5 Compare January 22, 2021 19:45
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@bcoe
bcoe force-pushed the benchmark-coverage branch from ae141a5 to 2823b83 Compare January 22, 2021 19:58
@nodejs-github-bot

nodejs-github-bot commented Jan 22, 2021

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/35683/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

richardlau
richardlau reviewed Jan 22, 2021
View reviewed changes
Comment thread benchmark/process/coverage.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

bcoe
benchmark: add benchmark for NODE_V8_COVERAGE
56cf8b5
@bcoe
bcoe force-pushed the benchmark-coverage branch from 2823b83 to 56cf8b5 Compare January 22, 2021 23:25
@bcoe
bcoe requested a review from richardlau January 22, 2021 23:25
richardlau
richardlau approved these changes Jan 22, 2021
View reviewed changes
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

nodejs-github-bot commented Jan 25, 2021 •
edited by bcoe
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/35719/ ✅

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bcoe pushed a commit that referenced this pull request Jan 27, 2021
bcoe
benchmark: add benchmark for NODE_V8_COVERAGE
8c9dc4e
PR-URL: #36972
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@bcoe

bcoe commented Jan 27, 2021

Copy link
Copy Markdown
Contributor Author

Landed in 8c9dc4e

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bcoe bcoe closed this Jan 27, 2021
targos pushed a commit that referenced this pull request Feb 2, 2021
bcoe @targos
benchmark: add benchmark for NODE_V8_COVERAGE
dcd34b0
PR-URL: #36972
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@targos targos mentioned this pull request Feb 2, 2021
v15.8.0 release proposal #37183
Merged
targos pushed a commit that referenced this pull request May 1, 2021
bcoe @targos
benchmark: add benchmark for NODE_V8_COVERAGE
d2770a5
PR-URL: #36972
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
v14.17.0 proposal #38507
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@Trott Trott Trott approved these changes
@benjamingr benjamingr benjamingr approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
@richardlau richardlau richardlau approved these changes
@targos targos Awaiting requested review from targos
@devsnek devsnek Awaiting requested review from devsnek

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

benchmark Issues and PRs related to Node.js benchmarks and benchmarking infrastructure. process Issues and PRs related to the process subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@bcoe @Trott @nodejs-github-bot @jasnell @benjamingr @joyeecheung @richardlau
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.