Skip to content

Explore manually specializing Scan #42

@Others

Description

@Others

It might provide a performance boost if we add methods to Scan that are manually specialized methods of existing calls from the collect method.

Right now we can't make the trait method scan generic over any closure without violating object safety. That means scanning an object requires potentially many indirect calls to the trait object closure. (This also inhibits optimizations I believe.) If for every collector call to scan we added a method scan_??? that had the closure manually inlined for that call, we might be able to get a perf boost.

This is a big readability/performance tradeoff imo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-optimizationSomething is slower than it needs to be

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions