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 — fix: faster diff by H4ad · Pull Request #539 · npm/node-semver

Conversation

@H4ad

@H4ad H4ad commented Apr 7, 2023

Copy link
Copy Markdown
Contributor

Based on the comment here: #533 (comment)

The performance before:

diff(0.0.1, 0.0.1-pre) x 310,595 ops/sec ±1.86% (94 runs sampled)
diff(0.0.1, 0.0.1-pre-2) x 317,054 ops/sec ±0.33% (92 runs sampled)
diff(1.1.0, 1.1.0-pre) x 304,229 ops/sec ±1.80% (86 runs sampled)

After:

diff(0.0.1, 0.0.1-pre) x 480,421 ops/sec ±0.86% (96 runs sampled)
diff(0.0.1, 0.0.1-pre-2) x 471,080 ops/sec ±0.99% (94 runs sampled)
diff(1.1.0, 1.1.0-pre) x 476,067 ops/sec ±0.98% (95 runs sampled)
benchmark.js
const Benchmark = require('benchmark')
const diff = require('./functions/diff')
const suite = new Benchmark.Suite()

const cases = [
  ['0.0.1', '0.0.1-pre', 'patch'],
  ['0.0.1', '0.0.1-pre-2', 'patch'],
  ['1.1.0', '1.1.0-pre', 'minor'],
]

for (const [v1, v2] of cases) {
  suite.add(`diff(${v1}, ${v2})`, function () {
    diff(v1, v2)
  })
}

suite
  .on('cycle', function (event) {
    console.log(String(event.target))
  })
  .run({ async: false })

References

Sorry, something went wrong.

Uh oh!

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

All reactions
@H4ad
fix: faster diff by avoid parsing twice
93cd307
@H4ad
H4ad requested a review from a team as a code owner April 7, 2023 00:55
@H4ad
H4ad requested review from wraithgar and removed request for a team April 7, 2023 00:55
@wraithgar wraithgar mentioned this pull request Apr 7, 2023
fix: semver.diff prerelease to release recognition #533
Merged
wraithgar
wraithgar approved these changes Apr 7, 2023
View reviewed changes
@wraithgar

wraithgar commented Apr 7, 2023

Copy link
Copy Markdown
Contributor

This one is very small and clearly an improvement, so I'm merging it now.

H4ad reacted with heart emoji H4ad reacted with rocket emoji
All reactions
  • ❤️ 1 reaction
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

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

@wraithgar
wraithgar merged commit f66cc45 into npm:main Apr 7, 2023
@github-actions github-actions Bot mentioned this pull request Apr 7, 2023
chore: release 7.4.0 #540
Merged
@H4ad
H4ad deleted the fix/faster-diff branch April 7, 2023 01:22
@macno macno mentioned this pull request Apr 12, 2023
fix: avoid re-instantiating SemVer during diff compare #547
Merged
@ms-bot ms-bot mentioned this pull request Apr 17, 2023
chore(deps): bump 🧳 semver to ^7.6.3 mobsuccess-devops/pmd-github-action#11
Closed
@snyk-bot snyk-bot mentioned this pull request May 16, 2023
[Snyk] Upgrade semver from 6.3.0 to 7.5.0 OutSystems/cordova-plugin-add-swift-support#3
Closed
This was referenced Jul 31, 2023
Bump semver from 7.3.5 to 7.5.2 in /platform/ui ossrs/oryx#107
Closed
Bump semver from 7.3.5 to 7.5.2 in /ui ossrs/oryx#116
Closed
This was referenced May 24, 2024
[Snyk] Upgrade semver from 7.3.7 to 7.6.0 NOUIY/npm-groovy-lint#71
Closed
[Snyk] Upgrade semver from 7.3.8 to 7.6.0 NOUIY/security-wg#55
Closed
@devcurt696 devcurt696 mentioned this pull request May 29, 2024
[Snyk] Upgrade semver from 7.0.0 to 7.6.1 devcurt696/resume-builder#77
Open
@NOUIY NOUIY mentioned this pull request May 30, 2024
[Snyk] Upgrade semver from 7.3.7 to 7.6.1 NOUIY/npm-groovy-lint#77
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@wraithgar wraithgar wraithgar approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

2 participants

@H4ad @wraithgar
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 01402775 — 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.