I've built a ray tracer in Java. It generates images like this:
(this is not mine, it's just an example). I multithreaded it by cutting up the image horizontally and telling each thread to render a chunk of the final image. I did quite a few tests and these are the average times:
1 thread: 35 seconds
2 threads: 21 seconds
4 threads: 20 seconds
8 threads: 21 seconds
I own a Intel Wolfdale @ 3.0 GHz (Dual Core). The improvement when going to 2 threads is obvious, but I can't make sense of why going to 4 threads makes it go even faster. I thought Intel didn't have hyperthreading since Pentium IV, so my 2 cores mean that I can only run 2 threads simultaneously. The dip in 8 threads makes sense because of more context switching.
(this is not mine, it's just an example). I multithreaded it by cutting up the image horizontally and telling each thread to render a chunk of the final image. I did quite a few tests and these are the average times:
1 thread: 35 seconds
2 threads: 21 seconds
4 threads: 20 seconds
8 threads: 21 seconds
I own a Intel Wolfdale @ 3.0 GHz (Dual Core). The improvement when going to 2 threads is obvious, but I can't make sense of why going to 4 threads makes it go even faster. I thought Intel didn't have hyperthreading since Pentium IV, so my 2 cores mean that I can only run 2 threads simultaneously. The dip in 8 threads makes sense because of more context switching.