ziggy:
The thing is, I didn't bother to try making it threaded. Even if I would have been able to halve the time taken by using two threads (unlikely), it would have been slower than unthreaded.
Note that my code was almost pure math and used one CPU almost 100%. For something like the parser you mention, there could be additional benefits from backgrounding memory access.
ImaginaryHuman:
Isn't memory access rather fast these days? With DDR3 becoming popular, I don't think that will be such a huge bottleneck compared to using a single CPU core. They will probably not increase the speed of CPUs in the near future, but add more cores instead. Also, modern multi-cores have dedicated caches for each core and the sizes are increasing.
Code designed to work a on a single thread bmax compilation is usually slower on threaded mode. when the diference of time is this big, it usually means the code has to be redesigned, or optimized. Obviously if you're writing a threaded application from the begining, you would not be getting this issues.
The thing is, I didn't bother to try making it threaded. Even if I would have been able to halve the time taken by using two threads (unlikely), it would have been slower than unthreaded.
Note that my code was almost pure math and used one CPU almost 100%. For something like the parser you mention, there could be additional benefits from backgrounding memory access.
ImaginaryHuman:
You could throw 16 cores at it but if they're all accessing the same memory each thread will be held up by memory accesses. I would also think that if you are doing operations that entail a lot of memory access - like working with strings, then memory is going to become a bottleneck and the cpu is going to be kept waiting. Also if the cpu's have to share the memory bus one is going to have to stall while the other one has bus access.
Isn't memory access rather fast these days? With DDR3 becoming popular, I don't think that will be such a huge bottleneck compared to using a single CPU core. They will probably not increase the speed of CPUs in the near future, but add more cores instead. Also, modern multi-cores have dedicated caches for each core and the sizes are increasing.