this post was submitted on 13 Oct 2025
10 points (85.7% liked)

Cool GitHub Projects

1597 readers
1 users here now

Wormhole

!code_review@programming.dev

Icon base by Caro Asercion under CC BY 3.0 with modifications to add a gradient

founded 2 years ago
MODERATORS
all 7 comments
sorted by: hot top controversial new old
[–] entwine@programming.dev 3 points 1 month ago (1 children)

This doesn't appear optimal. The correct way to melt a CPU is to make use of as many functional units as possible in parallel, while avoiding pipeline stalls and cache misses. I'm not a Rust guy, but skimming through the code it seems like the only work it's doing is some integer math, so it's not even touching the FPUs. Also I see while running.load(Ordering::SeqCst). Idk if Rust's memory model is similar to C++, but does that mean it's using atomic operations? That's going to create a lot of unnecessary cache coherency traffic that works against the goal of melting. Each thread should have its own counter not shared with other threads, and it should only spawn enough threads for the number of physical cores (not logical cores) on the system, and ideally pin each thread to a single core to prevent the OS from acting like a firefighter.

The gpu parts I'm not sure about. There's might be some special consideration required when dealing with integrated graphics though.

[–] sukhmel@programming.dev 1 points 1 month ago

Yeah, Rust borrows memory model from C++ because it's already in use and is at least somewhat understandable

[–] jasory@programming.dev 3 points 1 month ago (1 children)

Any embarrassingly parallel program can max out your CPU. You should probably run some useful problem instead.

[–] onlinepersona@programming.dev 4 points 1 month ago

Protein folding for example

[–] BB_C@programming.dev 2 points 1 month ago

At least use a SIMD load, and maybe someone would find it cool-adjacent.