Hello all,
I started looking into multi-threaded extensions to some applications of mine. As I'm completely new to this I would appreciate some guidance
on speed-up and efficienvy figures I see. So my questions indeed target people who actually (and successfully) work with multi-threading
developments in Free Pascal.
Here is a simple breakdown of my environment:
- CPU: AMD Ryzen 7 7730U, 8 physical, 16 SMT cores
- Mem: 16 GByte
- OS: Win 11 Home, 25H2, 26200.8655
- Lazarus: 4.2
- FPC: 3.2.2
Here is what I'm doing:
- I have computational tasks that I can divide into fully independent sub-tasks (no common data, no synch requirements, etc.)
- I use threadpool-fp (
https://github.com/ikelaiah/threadpool-fp) in the simple 'fire-and-forget' variant to multi-thread
- the data memory footprint ranges from small (1 MByte) over medium (10 MByte) to large (100 MByte)
- I use my own pure Pascal and assembler enhanced compute kernels
- I minimised heap management, allocating one large chunk and doing pointer math to provide fitting parts to sub-tasks
- I don't do anything 'special' yet, like playing with affinity or priority, switch to large/hughe OS memory tables etc.
Here is what i measure:
- using pure Pascal kernels
- 8 threads (aligned to physical core count) provide speed-up ~5.8 vs single thread and efficiency of ~73% vs physical cores
- 16 threads (aligned to SMT core count) provide speed-up ~6.6 vs single thread and efficiency of ~83% vs physical cores
- using assembler enhanced kernels
- 8 threads (aligned to physical core count) provide speed-up ~4.6 vs single thread and efficiency of ~58% vs physical cores
- 16 threads (aligned to SMT core count) provide speed-up ~4.8 vs single thread and efficiency of ~60% vs physical cores
Here are my questions:
- do the above figures look reasonable?
- can I expect substantial/measurable improvements if I invest in 'specials' and what would those be?
Kind regards,
MathMan