File tree Expand file tree Collapse file tree
src/FSharp.Control.AsyncSeq
tests/FSharp.Control.AsyncSeq.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -579,7 +579,7 @@ module AsyncSeq =
579579 if box resource <> null then dispose resource)
580580
581581 member x.For ( seq : seq < 'T >, action : 'T -> AsyncSeq < 'TResult >) =
582- collect action ( ofSeq seq)
582+ collectSeq action seq
583583
584584 member x.For ( seq : AsyncSeq < 'T >, action : 'T -> AsyncSeq < 'TResult >) =
585585 collect action seq
Original file line number Diff line number Diff line change @@ -742,6 +742,9 @@ let perfTest2 n =
742742//perfTest2 1000000 0.663
743743
744744
745+ // This was the original ofSeq implementation. It is now faster than before this perf testing
746+ // took place, but is still slower than the bespoke ofSeq implementation (which effectively "knows"
747+ // that a single yield happens for each iteration of the loop).
745748let ofSeq2 ( source : seq < 'T >) = asyncSeq {
746749 for el in source do
747750 yield el }
@@ -760,4 +763,4 @@ let perfTest3 n =
760763//perfTest3 5000 0.009
761764//perfTest3 10000 0.015
762765//perfTest3 100000 0.155
763- //perfTest3 1000000 1.645
766+ //perfTest3 1000000 1.500
You can’t perform that action at this time.
0 commit comments