|
|
|
|
|
by danudey
588 days ago
|
|
I played around a bit lately with finding ways to dramatically multithread code in golang, mostly for fun. What I found was that there was a threshold where the overhead of spinning up all the threads at the start and synchroninzing them at the end overwhelmed the time savings from actually performing the work in multiple threads. It wouldn't surprise me if PDF renderer and background blur were fast enough tasks that spinning up 96 threads to split rendering across all those cores was a waste of time compared to how fast the actual task was to complete. It was akin to trying to hammer in 50 nails by getting 50 people and handing out 50 hammers and assigning each person one nail, then telling them "okay, start!", then inspecting everyone's work afterwards; at some point, it's faster just to break it into two or three tasks. |
|