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

add CCArray.of_iter #472

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

illusory0x0
Copy link

@illusory0x0 illusory0x0 reopened this Jan 29, 2025
Copy link
Owner

@c-cube c-cube left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks useful, do you also want to add the updated benchmarks?

val of_iter : 'a iter -> 'a t
(** [of_iter iter] builds a array from a given [iter].
In the result, elements appear in the same order as they did in the source [iter].
@since 3.15 *)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I normally use @since NEXT_RELEASE :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@illusory0x0
Copy link
Author

Looks useful, do you also want to add the updated benchmarks?

should we add more benchmark?

when iter_len very small, use list as buffer is faster than other implementation.

@c-cube
Copy link
Owner

c-cube commented Jan 30, 2025

lists might be faster for small sizes, but what about large sizes? does it get worse?

@illusory0x0
Copy link
Author

it would get worse.

look this benchmark for more details

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 this pull request may close these issues.

2 participants