Skip to content

Add perf markers to hint filtering and fix perf commands#5343

Open
repparw wants to merge 1 commit into
tridactyl:masterfrom
repparw:perf-markers-only
Open

Add perf markers to hint filtering and fix perf commands#5343
repparw wants to merge 1 commit into
tridactyl:masterfrom
repparw:perf-markers-only

Conversation

@repparw
Copy link
Copy Markdown
Contributor

@repparw repparw commented Feb 17, 2026

Summary

This PR adds performance profiling infrastructure for hint filtering and fixes bugs in the existing perf commands.

Changes

1. Perf markers in hint filtering (src/content/hinting.ts)

Added Perf.Marker instrumentation to filterHintsSimple and filterHintsVimperator functions to measure hint filtering performance:

  • filterHintsSimple - measures simple prefix-based hint filtering
  • filterHintsVimperator - measures vimperator-style hint filtering with text matching

These markers allow benchmarking hint filtering performance before/after optimizations.

2. Fixed perfdump/perfhistogram commands (src/excmds.ts)

The original implementation used open("data:...") to display results, which is blocked by Firefox for extensions due to security restrictions. Changed to:

  • Output to browser console for easy viewing
  • Copy results to clipboard for pasting elsewhere
  • Show a message in the command line with result summary

3. Fixed StatsFilter.matches() (src/perf.ts)

Fixed a bug where StatsFilter.matches() would crash when processing performance entries that don't match the expected tri/Owner/Function:suffix naming pattern. Added null check to handle entries that can't be parsed.

Usage

To profile hint filtering performance:

:set perfcounters true
# Use hint filtering (press f and type to filter)
:perfhistogram Hinting/

This enables measuring and comparing hint filtering performance on pages with many links (e.g., GitHub file listings).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant