Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Apr 8, 2025

Context

Because we run @-mention's regex every keystroke in chat area, we need tracking the change of regex performance when we add new feature to @-mention

Implementation

Screenshots

before after

How to Test

Get in Touch


Important

Adds benchmarking scripts for mentionRegexGlobal to track performance changes with various test cases and saves results for future reference.

  • Benchmarking:
    • Adds mention-regex-benchmark.ts to benchmark mentionRegexGlobal from context-mentions.ts.
    • Includes test cases for file paths, URLs, special words, git hashes, mixed content, punctuation, large text, and typing simulation.
    • Results saved in results/mention-regex-benchmark-[timestamp].md and results/mention-regex-benchmark-latest.md.
  • Scripts:
    • Adds run-mention-benchmark.js for easy command-line execution of the benchmark.
  • Regex:
    • Refactors mentionRegex in context-mentions.ts to use separate patterns for paths, URLs, git hashes, and keywords.

This description was created by Ellipsis for 118c4f7. It will automatically update as commits are pushed.

@samhvw8 samhvw8 requested review from cte and mrubens as code owners April 8, 2025 04:40
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 8, 2025
console.log(`Running benchmark for: ${name}`)

let totalMatches = 0
const startTime = performance.now()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider explicitly importing performance from perf_hooks to ensure compatibility with Node versions that don't have a global performance object.

// Get the project root directory
const projectRoot = path.resolve(__dirname, "../..")

// Run the benchmark using ts-node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment refers to ts-node, but the script uses 'tsx'. Please update the comment to accurately reflect the tool being used.

Suggested change
// Run the benchmark using ts-node
// Run the benchmark using tsx

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 10, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Needs Review] in Roo Code Roadmap May 26, 2025
@daniel-lxs
Copy link
Member

Thank you for your contribution.

We are closing this PR because we would like to have an issue created for this following our issue-first workflow. Please create an issue if you plan to revisit this.

We truly appreciate your patience and would be happy to have you continue contributing.

@daniel-lxs daniel-lxs closed this May 27, 2025
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap May 27, 2025
@github-project-automation github-project-automation bot moved this from Needs Preliminary Review to Done in Roo Code Roadmap May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Needs Preliminary Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants