ImHex
ImHex copied to clipboard
[Bug] `[[format(...)]]` is extremely slow, as opposed to `[[name(...)]]`
Operating System
Linux
What's the issue you encountered?
My first attempt at writing a pattern, I used name
to display array elements, but realised that format
is probably the more proper option. However, format
causes a noticeable drop in editor framerate and makes editing difficult, while name
does not.
How can the issue be reproduced?
- Load the provided binary and pattern file
- Expand any of the arrays once
- Observe change in editor framerate, if any
Using the pattern with [[format()]]
, the framerate should drop significantly, while [[name()]]
should be fine.
ImHex Version
1.27.1
ImHex Build Type
- [X] Nightly or built from sources
Installation type
AUR
Additional context?
Built to version 1.27.1 using git tag.
pattern using [[name()]]
: https://score.moe/a/imhex/defines_name.hexpat
pattern using [[format()]]
: https://score.moe/a/imhex/defines_format.hexpat
test file: https://score.moe/a/imhex/defs_rse_flag.dat
That is because name
changes the display name, which only copies the string from the attribute to the display viewer, as opposed to format
which takes in the value of the element into a function which needs to be called and also the value needs to be copied over. format is used for formatting values and if you just need to statically name array elements name should be fine
Thanks for the response. Since this is intended to provide a display format
for the structs in question, is there any faster way to use the format
attribute? My expectation would be that the format text would not need to
be re-evaluated, since the data itself doesn't change.
On Mon, 6 Mar 2023, 11:19 Justus Garbe, @.***> wrote:
That is because name changes the display name, which only copies the string from the attribute to the display viewer, as opposed to format which takes in the value of the element into a function which needs to be called and also the value needs to be copied over. format is used for formatting values and if you just need to statically name array elements name should be fine
— Reply to this email directly, view it on GitHub https://github.com/WerWolv/ImHex/issues/965#issuecomment-1455949022, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAISKZQWDK43H7KCRA2YFPTW2XB5JANCNFSM6AAAAAAVQ6JOZM . You are receiving this because you authored the thread.Message ID: @.***>
This issue is marked stale as it has been open for 11 months without activity. Please try the latest ImHex version. (Avaiable here: https://imhex.download/ for release and https://imhex.download/#nightly for development version) If the issue persists on the latest version, please make a comment on this issue again
Without response, this issue will be closed in one month.