Commit 3ceb0d4
authored
Limit meshing to 1 thread (#1254)
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+361 parent e5b46bc commit 3ceb0d4
File tree
1 file changed
+1
-2
lines changed- amulet_map_editor/api/opengl/mesh/level/chunk
1 file changed
+1
-2
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
370 | | - | |
| 369 | + | |
371 | 370 | | |
372 | 371 | | |
373 | 372 | | |
| |||
0 commit comments