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

assert: make myers_diff function more performant #56303

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

puskin94
Copy link
Contributor

@puskin94 puskin94 commented Dec 18, 2024

now that Myers diff has landed, I took the liberty to review the code I wrote to look for improvements that would squeeze some more performance out of the comparison mechanism

  • simplified some logic
  • reviewed loops and introduced more breaking points to make them run for less cycles
  • reduced memory allocation using Int32Array

Refs: #54862

@nodejs-github-bot nodejs-github-bot added assert Issues and PRs related to the assert subsystem. needs-ci PRs that need a full CI run. labels Dec 18, 2024
@puskin94 puskin94 force-pushed the assert-make-myers-more-performant branch from 525ec2c to a00f603 Compare December 18, 2024 10:52
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 82.85714% with 6 lines in your changes missing coverage. Please review.

Project coverage is 88.54%. Comparing base (0d00511) to head (f719438).

Files with missing lines Patch % Lines
lib/internal/assert/myers_diff.js 82.85% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56303      +/-   ##
==========================================
+ Coverage   88.04%   88.54%   +0.50%     
==========================================
  Files         657      657              
  Lines      190290   190298       +8     
  Branches    36245    36538     +293     
==========================================
+ Hits       167536   168504     +968     
+ Misses      15893    14986     -907     
+ Partials     6861     6808      -53     
Files with missing lines Coverage Δ
lib/internal/assert/myers_diff.js 89.14% <82.85%> (-0.68%) ⬇️

... and 93 files with indirect coverage changes

@puskin94 puskin94 force-pushed the assert-make-myers-more-performant branch from a00f603 to f719438 Compare December 18, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants