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

perf(message): replace vim.b.messages with lua variable #898

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

jedrzejboczar
Copy link
Contributor

Description

Using vim.b variables seems slow for big tables. This PR improves performance of command output redirection (and possibly other places). From my tests this is an order of 20 sec -> 4 sec.

Also, it looks like the current code sometimes assumes that vim.b[buf].messages is a list of buffers, while it is a list of message ids. I also changed it from a list to a set, because it's mostly used for random access.

Related Issue(s)

This helps in case described here: #332 (filetype is still applied many times, but from my recent benchmarks it seems that vim.b.messages had bigger impact).

@jedrzejboczar jedrzejboczar changed the title perf: replace vim.b.messages with lua variable perf(message): replace vim.b.messages with lua variable Jul 15, 2024
@folke folke merged commit 7ecc05d into folke:main Jul 15, 2024
2 of 3 checks passed
@folke
Copy link
Owner

folke commented Jul 15, 2024

Damn, that's crazy! ty!

folke pushed a commit that referenced this pull request Jul 15, 2024
🤖 I have created a release *beep* *boop*
---


## [4.4.2](v4.4.1...v4.4.2)
(2024-07-15)


### Performance Improvements

* **message:** replace vim.b.messages with lua variable
([#898](#898))
([7ecc05d](7ecc05d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants