Open Cletip opened 1 year ago
They are different. Bang variants accept metadata as their argument.
You see, vulpea-meta-get
actually parses metadata using vulpea-meta
and then passes it to vulpea-buffer-meta-get!
.
Parsing metadata is not that expensive, but is not free. So if you want to read multiple values from the metadata list, you better parse metadata once using vulpea-meta
and then use it to access needed values. For example, I use it in vino:
https://github.com/d12frosted/vino/blob/0ddf2268a716165c05efe1282269772e35415ab0/vino.el#L632-L670
Oh right, I didn't quite understand. I thought the function was the same thing in the end, because one refers to the other (I had looked at how it was made). But in fact, one refers to the other WITH another, hence the difference in performance you mention. Okay, I just figured it out.
I had a little trouble understanding, because the readme have"vulpea-meta-get!" and not "vulpea-meta-get", and knowing that other function with "!" existed, I just thought that one was more efficient than the other.
Thanks you a lot for your answer.
You're welcome. Thanks for reading README. I think I need to revamp some sections to make them more clear and reflect some of the latest changes.
Np. By the way, I find your readme particularly well done: there are many examples and I find it well ordered. If I can make a criticism, I find that the part about metadata is "separate", which may be confusing. Well, this is only my opinion.
Keep me informed about the moddifications of the readme if you make some change, you will have an external opinion ^^
I don't close the issue, but you can do it if you want ;)
I was looking for how to use metadata in a good way for performance.
I was thinking about this part "Functions of interest:
vulpea-meta - function to get metadata from NOTE-OR-ID. In most cases you should not use this function unless performance is important. In this case, take a look at bang functions, e.g. vulpea-meta-get!"
I do believe that in the end, from what I understood from the code, most of the functions boil down to "vulpea-buffer-meta-X" style functions. So I thought, according to the readme, that there was a difference between the functions. But actually, I think not ^^