Merged
Conversation
sxyazi
added a commit
that referenced
this pull request
Apr 4, 2025
Contributor
|
ya.manager_emit/ya.mgr_emit throw this error, also new: Also extract.lua plugin still using old |
sxyazi
added a commit
that referenced
this pull request
Apr 4, 2025
Owner
Author
|
Thanks for reporting, fixed in 9565c1b |
GrzegorzKozub
added a commit
to GrzegorzKozub/yazi
that referenced
this pull request
Apr 5, 2025
Contributor
|
@sxyazi This also broke plugin vcs-files: Here is the error message. |
Owner
Author
|
Fixed in fd007ab |
Lemi0002
pushed a commit
to Lemi0002/yazi
that referenced
this pull request
Apr 10, 2025
imsi32
added a commit
to imsi32/yatline.yazi
that referenced
this pull request
Apr 11, 2025
details: With the new release of Yazi, some methods are changed to properties. see: - sxyazi/yazi#2572
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a longstanding issue in the plugin system where every field access triggers redundant memory allocation. For example, when getting the currently selected file
Url:Every time the
.urlfield is accessed, a newUrlis allocated. During UI rendering, theseUrls are used repeatedly in multiple render functions, leading to unnecessary memory allocation.Also, each access of
.active,.current, and.hoveredcreates a new UserData. Although UserData is lighter compared toUrls, they still all need to be destroyed after rendering ends.With this PR, these field accesses will be globally cached and created only once. This means that every function will share the same object, avoiding repeated memory allocation and destruction.
frag,name,stem,ext, andparentonUrlare now properties.nameontab::Tabis now a property.is_hoveredonfs::Fileis now a property.For instance:
Previously, these were methods to hint that each call would create a new object. With field caching, they are now treated as cacheable properties and are guaranteed to allocate memory at most once on access, simplifying the code at the same time.