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

Always expand and create slice rather than to use an own iter type #18

Closed
yutannihilation opened this issue Sep 18, 2023 · 0 comments · Fixed by #19
Closed

Always expand and create slice rather than to use an own iter type #18

yutannihilation opened this issue Sep 18, 2023 · 0 comments · Fixed by #19

Comments

@yutannihilation
Copy link
Owner

The benchmark shows iter() is slow. This is probably because the std's slice implementation is clever than my poor implementation.

https://github.com/rust-lang/rust/blob/078eb1120a3f576598b976d9470701363f48fccc/library/core/src/slice/iter/macros.rs#L64

extendr always expands ALTREP and create a slice.

https://github.com/extendr/extendr/blob/2992da0b3c71b7be2622ed9b5a4bc72869e3ccbc/extendr-api/src/robj/mod.rs#L757-L767

While it's doable to copy these code, even in ALTREP cases, savvy is slower than extendr, so probably it's not worth.

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

Successfully merging a pull request may close this issue.

1 participant