Re: [fpc-pascal] GetMem slow in threads

2024-11-09 Thread Marco van de Voort via fpc-pascal
Op 9-11-2024 om 14:59 schreef Hairy Pixels via fpc-pascal: The solution would be to be to use a different allocator but because FPC only allows overriding NewInstance per class it would be mean you would need a mutex anyway to control which allocator was used depending on the thread. Maybe

[fpc-pascal] GetMem slow in threads

2024-11-09 Thread Hairy Pixels via fpc-pascal
I diagnosed a threading performance problem down to merely calling GetMem. I did a test and it was 4x slower to call GetMem on 8 threads (my computer core count) than one thread. Due the large amount of allocations in the program it was actually slower to multithread the task. I assume the problem