Type casting for speedup
- Dominant language
- C++
- Stars
- 5.8k
- Forks
- 471
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 81
Description
After reading this text: https://github.com/google/highway/blob/476ef01ba056e3dd88de680382dd831747be8bd4/hwy/contrib/sort/README.md?plain=1#L354-L356
and looking to the numbers in the table (20+% diff between f64 and i64),
I remembered that I have 2 y. o. repo which investigates
such approach for scalar sorting: https://github.com/alantudyk/sort_floats_as_uints
Of course, it works for `f -> i`, but doesn't work for `i -> f` because of `NaN`s.
Solution: partition for NaN and non-NaN parts, sort them separately (changing exponent bits in `NaN`s before and after sorting).
Contributor guide
Research direction
Start with contrib/sort/README.md at the linked lines and review the referenced sort_floats_as_uints repository. Locate the corresponding Highway sorting implementation and benchmark the proposed f64/i64 approach, including NaN handling. Done requires an agreed implementation scope and measurements showing whether the speedup is worthwhile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100