Skip to content

Optimize Bot Filter: Cache Ignored Authors to Enhance Performance - #8985

Open
tamilr0727-ux wants to merge 1 commit into
JhaSourav07:mainfrom
tamilr0727-ux:fix/bot-filter-sync-io
Open

Optimize Bot Filter: Cache Ignored Authors to Enhance Performance#8985
tamilr0727-ux wants to merge 1 commit into
JhaSourav07:mainfrom
tamilr0727-ux:fix/bot-filter-sync-io

Conversation

@tamilr0727-ux

Copy link
Copy Markdown
Contributor

Description

Optimizes getIgnoredAuthors() in lib/bot-filter.ts by eliminating repeated synchronous filesystem operations when checking bot authors across large commit datasets.

Changes

  1. Prevented .commitpulse.json from being read from disk on every isBotAuthor() invocation.
  2. Added caching/memoization for ignored-author configuration.
  3. Ensured configuration is loaded once and reused across repeated bot-author checks.
  4. Avoided repeated fs.existsSync() and fs.readFileSync() calls inside array operations such as .filter().
  5. Preserved existing bot detection and ignored-author behavior.
  6. Added regression and performance-focused tests for repeated author lookups.

Verification

vitest run passes successfully.
✅ Repeated isBotAuthor() calls no longer trigger unnecessary synchronous disk reads.
✅ Existing bot-filtering behavior remains unchanged.
✅ Large commit datasets can be processed more efficiently.

Fixes #8982

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

Can Check in the Files Changed Section.

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@tamilr0727-ux is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@retenta-bot

retenta-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

This pull request introduces significant optimizations to the bot author detection mechanism by caching ignored authors, which should enhance performance, especially with large datasets. This aligns with our previous decisions to optimize performance in similar contexts, such as the CI analytics service for large repositories. It's great to see these improvements being implemented! Looking forward to your review. 😊

@retenta-bot retenta-bot Bot changed the title fix(bot-filter): cache ignored authors to prevent blocking event loop Optimize Bot Filter: Cache Ignored Authors to Enhance Performance Aug 10, 2026
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Aug 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Hey @tamilr0727-ux, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

Please fix the issues before this can be reviewed. Here's how:

1. Run checks locally before pushing:

npm run format:check   # Check Prettier formatting
npm run lint           # Run ESLint
npm run typecheck      # TypeScript type check
npm run test           # Run unit tests (Vitest)
npm run build          # Verify production build passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

@github-actions github-actions Bot added the type:bug Something isn't working as expected label Aug 12, 2026
@tamilr0727-ux
tamilr0727-ux force-pushed the fix/bot-filter-sync-io branch from 24d2978 to 000a05f Compare August 12, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:blocked This PR is blocked due to a failing CI check. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Synchronous file I/O in getIgnoredAuthors blocks event loop during commit filtering

1 participant