Skip to content

"perf: cache package metadata lookups"#1886

Merged
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
namrarafique93-del:perf/cache-package-metadata
Jun 3, 2026
Merged

"perf: cache package metadata lookups"#1886
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
namrarafique93-del:perf/cache-package-metadata

Conversation

@namrarafique93-del
Copy link
Copy Markdown
Contributor

Summary

Cache package metadata during subpath validation to avoid repeated filesystem reads and JSON parsing for the same package.

Closes #1885


Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • Added an in-memory cache for package metadata
  • Reused cached package.json data across validations
  • Reduced repeated calls to "require.resolve()"
  • Reduced repeated filesystem reads and JSON parsing
  • Preserved existing validation behavior

How to Test

Steps for the reviewer to verify this works:

  1. Run the dependency checker on a project containing multiple imports from the same package
  2. Confirm the output matches the current implementation
  3. Verify no regressions in subpath validation
  4. Ensure all existing checks continue to pass

Screenshots (if UI change)

N/A


Checklist

  • Linked issue in summary
  • Self-reviewed the diff
  • No behavior changes introduced
  • Added/updated tests if applicable

Additional Notes

This change is a performance optimization only. It reduces redundant package metadata lookups while maintaining the existing validation logic and output.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@namrarafique93-del is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:performance GSSoC type bonus: performance (+15 pts) labels Jun 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level:intermediate GSSoC: Intermediate difficulty (35 pts) quality:clean GSSoC: Clean quality multiplier (×1.2) labels Jun 3, 2026
@Priyanshu-byte-coder Priyanshu-byte-coder merged commit 6015acf into Priyanshu-byte-coder:main Jun 3, 2026
11 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

🎉 Merged! Thanks for contributing to DevTrack.

If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers.

Keep an eye on open issues for your next contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:intermediate GSSoC: Intermediate difficulty (35 pts) quality:clean GSSoC: Clean quality multiplier (×1.2) type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Cache package metadata during subpath validation

2 participants