Better HN
topnewbestaskshowjobs
Log inSign up

d265f278

6 karma · joined Apr 14, 2021 (5y ago) · 4 submissions

Submissions

1.

Show HN: C++23 constexpr n-dimensional Euclidean vector(github.com ↗)

1 points · by d265f278 · 2y ago · discuss

2.

Show HN: C17 Stuff(github.com ↗)

1 points · by d265f278 · 3y ago · discuss

comment 3y ago · link · parent

I've seen bounds checks being compiled to a single integer comparison followed by a jump (on x86 at least). This should have a negligible performance impact for most programs running on a modern, parallel CPU. However, for highly optimized programs that constantly saturate all processor instruction ports, bounds checks might of course become a bottleneck.

I think the most preferable solution (although not always possible) would be to use iterators as much as possible. This would allow rustc to "know" the entire range of possible indexes used at runtime, which makes runtime bounds checking redundant.

Some old benchmarks here: https://parallel-rust-cpp.github.io/v0.html#rustc

4.

Write text on the GitHub contribution heatmap(github.com ↗)

2 points · by d265f278 · 5y ago · discuss