Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sort: Find a way to parallelize number parsing #8061

@drinkcat

Description

@drinkcat

Especially after #8031 (pending PR), number parsing is a significant component of sort -g runtime (and possibly of other modes as well), maybe around ~70% of the runtime, as that part is single-threaded, while the sorting operation runs on multiple cores.

However, parallelizing chunks.rs parse_lines is challenging as there are side effects in line_data and we still need the data to be in the correct order. This might required extensive refactoring. We should find a way to make it parallel without sacrificing single-thread performance (at least not too much).

Testing setup:

seq 100 -0.000258 0 | sort -R > tmp/floatdata
cargo build --profile profiling -p uu_sort && samply record -r 10000 target/profiling/sort -g tmp/floatdata > /dev/null

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions