Skip to content
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

Switch to native int/num decode methods. #31

Closed
bbkr opened this issue Jan 17, 2019 · 3 comments
Closed

Switch to native int/num decode methods. #31

bbkr opened this issue Jan 17, 2019 · 3 comments

Comments

@bbkr
Copy link
Collaborator

bbkr commented Jan 17, 2019

Rakudo now has built-in methods that duplicate custom decodings in BSON code:
https://docs.perl6.org/type/Blob#Methods_on_blob8_only_(6.d,_2018.12_and_later)

They are really fast, so maybe it's worth switching to those methods?
Current methods can be left as fallback until most Rakudo builds (Star, linux, macOS) are at least 2019.01 (there were some issues with endian flags fixed after 2018.12).

@MARTIMM
Copy link
Owner

MARTIMM commented Aug 9, 2021

I am so sorry that I haven't seen your input. I somehow had unwatched the repo and therefore did not notice.
I'll will look into it

@MARTIMM
Copy link
Owner

MARTIMM commented Aug 11, 2021

I've implemented it. It's a pity it only provides reading (decoding) and not writing. All in all, my benchmark of a mixed elements doc is not really much faster though. About 45 encode/decode ops in a second. However, much better than the first test I ever did, about 6 times/sec. Most of the improvement is accounted for by Raku I think.

@MARTIMM MARTIMM closed this as completed Aug 11, 2021
@MARTIMM
Copy link
Owner

MARTIMM commented Aug 11, 2021

Oops, found the 'write' ones too! Still not much better. 46/47 times/sec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants