-
Notifications
You must be signed in to change notification settings - Fork 27
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
Lazy static completions #20
Conversation
could we break these up into 2 prs? please do the lazy statics. i like that change a lot :) then we can avoid the clones |
The point about lesser clones is a by-product of using lazy statics. The lazy static forces the use of static string slices in the cases I mentioned unless one goes out of their way to clone things. 😅 |
Also, it would be better in the long run to have the binary representation of the completion structs embedded in the final executable during comptime so we don't have to call |
ok, very interesting. i am going to try to review this once more and make sure i get what is going on. :) i may just need to download it and look at it in my editor |
i am also going to get #22 merged in first. may cause conflict, sorry |
Sure thing! I've synced this branch with upstream. |
psst, sorry about not merging this if you remove the conflicts, i can help get this in |
Sure, I'll resolve the conflicts by tomorrow.
|
I'm only considering the inclusion of lazy static for now, if I try to add more changes this PR becomes really massive. |
Hey just a heads up, it looks like OnceCell / OnceLock are actually more mature for our use case. There's also talk about deprecating lazy_static. Sorry for troubling you, I'm closing this. |
Changes
HX_TAGS
,HX_ATTRIBUTE_VALUES
andTEXT_STORE
from beingOnceLock
s to being lazy staticsinit_text_store
andinit_hx_tags
are now implicit.get()
for accessing attributes