-
Notifications
You must be signed in to change notification settings - Fork 54
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
Cache get decoder class from string #117
Conversation
…wn method. This allows caching, which greatly improves performance.
Hi @thewhaleking thanks for the PR. I agree if this function could be cached, it would be a great performance booster. I think I looked at this somewhere in the past, not sure why this is failing atm. Related on this topic, recently I have been working on a complete refactor and V2 of the scalecodec, which has a drastic performance boost as well. The only caveat is it doesn't work which runtimes < An example would be: scale_obj = Enum(
Bool=Bool(),
Number=U32,
Complex=Struct(data=String(), version=Compact(U8)),
None_=None
).new()
value = {'Bool': True}
data = scale_obj.encode(value) It is still work in progress but could be alpha released soon, it would be great if you could have a look as well and maybe have some feedback: https://github.com/polkascan/py-scale-codec/tree/az-v2 |
…t_type_string and compile the regex for faster execution.
…t_type_string and compile the regex for faster execution.
The failing was coming from the Definitely not at the same level as the initial cache idea, but this still offers a temporary speedup until you're able to fully implement and ship V2. |
@arjanz haven't had a chance to review the V2 stuff yet, but I plan to this week. |
@thewhaleking That would be appreciated! I'm out of office atm, when I have the chance I'll get back to you on the PR |
@arjanz Checked out the V2 stuff. It's some really good ideas, and stuff we actually had been discussing implementing on our own. I haven't gone through every line, but the async stuff is great from what I've seen. |
I'm back in the office; reviewed and tested your PR and looks good. Seems it will only impact pre I will merge the PR and schedule for next release, perhaps we can connect on Matrix to further discuss V2 |
I'm unfamiliar with Matrix, but let me know how to connect. Definitely interested in discussing more about V2, and can share where we're at with async stuff as it related to substrate. |
@thewhaleking you can join our channel at https://matrix.to/#/#polkascan:matrix.org |
Moved the logic from obtaining a decoder class from a string to its own method. This allows caching, which greatly improves performance.