Why is Json parsing slower in multiple threads?
Stefan Koch
uplink.coder at googlemail.com
Tue Jun 20 11:34:13 UTC 2023
On Tuesday, 20 June 2023 at 10:39:42 UTC, Alexandre Bourquelot
wrote:
> On Tuesday, 20 June 2023 at 10:29:04 UTC, Kagamin wrote:
>> The program does 3 times more work and gets it done in 3 times
>> more time: 1.5*3=4.5
>
> Thanks for your reply.
> I am using threads so the work should get done in the same time
> that it takes for one file to get processed, since its
> distributed across cores.
>
> I even wrote a similar C++ program just to be sure, that
> performs as expected.
try preallocating the memory you need.
it might very well be that the GC allocation lock slows you down.
More information about the Digitalmars-d
mailing list