Skip to content

Commit

Permalink
Replaced iterator_to_array with foreach in benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Oct 16, 2023
1 parent 32c77ec commit 0ec4a26
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class AvroExtractorBench
#[Revs(5)]
public function bench_extract_10k() : void
{
\iterator_to_array(Avro::from(__DIR__ . '/../Fixtures/orders_flow.avro')->extract(new FlowContext(Config::default())));
foreach (Avro::from(__DIR__ . '/../Fixtures/orders_flow.avro')->extract(new FlowContext(Config::default())) as $rows) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class CSVExtractorBench
#[Revs(5)]
public function bench_extract_10k() : void
{
\iterator_to_array(CSV::from(__DIR__ . '/../Fixtures/orders_flow.csv')->extract(new FlowContext(Config::default())));
foreach (CSV::from(__DIR__ . '/../Fixtures/orders_flow.csv')->extract(new FlowContext(Config::default())) as $rows) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class JsonExtractorBench
#[Revs(5)]
public function bench_extract_10k() : void
{
\iterator_to_array(Json::from(__DIR__ . '/../Fixtures/orders_flow.json')->extract(new FlowContext(Config::default())));
foreach (Json::from(__DIR__ . '/../Fixtures/orders_flow.json')->extract(new FlowContext(Config::default())) as $rows) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class ParquetExtractorBench
#[Revs(5)]
public function bench_extract_10k() : void
{
\iterator_to_array(Parquet::from(__DIR__ . '/../Fixtures/orders_flow.parquet')->extract(new FlowContext(Config::default())));
foreach (Parquet::from(__DIR__ . '/../Fixtures/orders_flow.parquet')->extract(new FlowContext(Config::default())) as $rows) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class TextExtractorBench
#[Revs(5)]
public function bench_extract() : void
{
\iterator_to_array(Text::from(__DIR__ . '/../Fixtures/annual-enterprise-survey-2019-financial-year-provisional-csv.csv')->extract(new FlowContext(Config::default())));
foreach (Text::from(__DIR__ . '/../Fixtures/annual-enterprise-survey-2019-financial-year-provisional-csv.csv')->extract(new FlowContext(Config::default())) as $rows) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class XmlExtractorBench
#[Revs(5)]
public function bench_extract() : void
{
\iterator_to_array(XML::from(__DIR__ . '/../Fixtures/simple_items.xml')->extract(new FlowContext(Config::default())));
foreach (XML::from(__DIR__ . '/../Fixtures/simple_items.xml')->extract(new FlowContext(Config::default())) as $rows) {
}
}
}

0 comments on commit 0ec4a26

Please sign in to comment.