Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve performance issues #140

Merged
merged 6 commits into from
Dec 24, 2024
Merged

fix: resolve performance issues #140

merged 6 commits into from
Dec 24, 2024

Conversation

leg100
Copy link
Owner

@leg100 leg100 commented Dec 24, 2024

When handling 100s or 1000s of modules some performance issues became evident. This PR fixes those issues.

  • prevent concurrent re-building of the explorer tree
  • move expensive rendering out of View() into bubbletea cmd
  • increase event buffer size to resolve deadlock when handling very large numbers of events (this is a hack and the underlying deadlock should really be detected and removed)

Findings from using pprof:

  • lipgloss.JoinVertical is expensive and often better replaced with strings.Join(..., "\n")
  • lipgloss.Render is expensive
  • regexes are expensive
  • pprof is good at determining how much is running as part of the Bubbletea event loop, and how much has been farmed out to Bubbletea commands. The bigger percentage of runtime in the latter, the better.

@leg100 leg100 merged commit 30a3793 into master Dec 24, 2024
3 checks passed
@leg100 leg100 deleted the perf branch December 24, 2024 12:27
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