Skip to content

Conversation

@gentlegiantJGC
Copy link
Member

On my 16 core CPU Amulet was maxing out the whole processor but was not getting much of a speed boost. I think most of the CPU time is spent spawning and destroying threads because the work being done is so small. After profiling it seems that adding more threads makes it a little faster but not much. Using all cores makes it run slower than just one. I think most of the benefit is from running the meshing code independently of the GIL. I have decided to limit meshing to 1 thread.

Tests (times in seconds + frames out of 60)
range with gil = 41+19
prange(cpu) = 33+24
prange(4) = 31+05
prange(2) = 31+14
prange(1) = 31+36

On my 16 core CPU Amulet was maxing out the whole processor but was not getting much of a speed boost.
I think most of the CPU time is spent spawning and destroying threads because the work being done is so small.
After profiling it seems that adding more threads makes it a little faster but not much. Using all cores makes it run slower than just one.
I think most of the benefit is from running the meshing code independently of the GIL.
I have decided to limit meshing to 1 thread.

Tests (times in seconds + frames out of 60)
range with gil = 41+19
prange(cpu) = 33+24
prange(4) = 31+05
prange(2) = 31+14
prange(1) = 31+36
@gentlegiantJGC gentlegiantJGC merged commit 3ceb0d4 into 0.10 Jan 14, 2026
3 checks passed
@gentlegiantJGC gentlegiantJGC deleted the limit-threads branch January 14, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants