Skip to content

"Hand Coded" Performance Comparisons #1

@timothy-shields

Description

@timothy-shields

For typical hand coded patterns, compare performance of functionally equivalent linq-cpp queries.

For example, compare the performance of A and B below:

std::vector<int> x = ...;

// A
std::vector<int> y(x.size());
std::transform(x.begin(), x.end(), y.begin(), [](int n){ return n * n; });
std::remove_if(y.begin(), y.end(), [](int n){ return (n % 3) != 0; });

// B
auto y = ix::from(x.begin(), x.end())
    .select([](int n){ return n * n; })
    .where([](int n){ return (n % 3) == 0; })
    .to_vector();

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions