Skip to content

Look up history commits through a hash map - #196

Open
latefinal wants to merge 1 commit into
phil294:masterfrom
latefinal:fix-history-recompute
Open

latefinal wants to merge 1 commit into
phil294:masterfrom
latefinal:fix-history-recompute

Conversation

@latefinal

Copy link
Copy Markdown

Fixes #195

history_mapped ran filtered_commits.value.find(...) once per history entry (up to 100) on every recompute, and selecting a commit pushes a history entry. Build one hash-to-commit map per commit list instead.

  • Same result as before: the first commit with a matching hash wins, and the commits are read through the reactive array as before, so they are the same proxy objects (checked with a Node script that compares both versions).
  • With 4,042 commits and 100 history entries, the recompute per click went from hundreds of milliseconds (1.2 to 1.5 s in my latest runs) to 0.03 ms. The map is built once per change of the commit list: 2.4 ms for 4,042 commits, 13 ms for 14,997 commits. In the real webview the click handler took 653 ms before the change; clicking commits no longer freezes the page.
  • This may be related to Performance regression since v0.1.34 on large repositories #191, where the History menu was suspected, but I have not verified that.
  • ESLint: I could not run it on .vue files in my setup (the parser crashes on the typed rules). vue-tsc --noEmit reports the same 23 errors before and after this change. The change adds no casts, @ts-ignores or comments.

history_mapped searched the whole commit list once for each of up to 100
history entries on every recompute. Every click on a commit pushes a
history entry, so the page froze for about 650 ms per click. Build one
hash to commit map per commit list instead.
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.

Selecting a commit freezes the UI when the History list is full

1 participant