Compare commits

..

2 commits

Author SHA1 Message Date
猗露
fd1495324a add benchmark 2025-01-30 10:07:48 +08:00
猗露
765a8da876 update docs 2025-01-30 09:37:57 +08:00
3 changed files with 5 additions and 3 deletions

View file

@ -1153,12 +1153,14 @@ module Iter_ = struct
let bench_to_array n =
let iter () = Iter.to_array Iter.(1 -- n)
and gen () = Gen.to_array Gen.(1 -- n)
and oseq () = OSeq.to_array OSeq.(1 -- n) in
and oseq () = OSeq.to_array OSeq.(1 -- n)
and of_iter () = CCArray.of_iter Iter.(1 -- n) in
B.throughputN 3 ~repeat
[
"iter.to_array", iter, ();
"gen.to_array", gen, ();
"oseq.to_array", oseq, ();
"ccarray.of_iter", of_iter, ();
]
let bench_cons n =

View file

@ -243,7 +243,7 @@ val to_iter : 'a t -> 'a iter
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 *)
@since NEXT_RELEASE *)
val to_seq : 'a t -> 'a Seq.t
(** [to_seq a] returns a [Seq.t] of the elements of an array [a].

View file

@ -251,7 +251,7 @@ val to_iter : 'a t -> 'a iter
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 *)
@since NEXT_RELEASE *)
val to_seq : 'a t -> 'a Seq.t
(** [to_seq a] returns a [Seq.t] of the elements of an array [a].