raytracing - Java raytracer increase CPU usage -


i tried implement raytracer in java , works fine. once, rendering scene , checked cpu-usage of program. every virtual core being used overall cpu-usage around 22-23%

i know when rendering cinema4d every virtual core being used 100%.

how archive this? make raytracer run 4 times faster? (23% -> 100%)

you should able 100% cpu usage, , else being equal, doing should result in faster rendering speed. you're apparently not @ 100% indicates me you're either not creating enough threads, or threads blocking on something.

i've found sweet spot 1 rendering thread per virtual core. can use api detect number of cores available @ runtime, , spawn many rendering threads. example of this, see my java ray tracer.

every virtual core being used overall cpu-usage around 22-23%

i'm not sure mean this, may want dig using performance profiler better understand how threads using cpu. ideally want each of threads working time. use visualvm visualize process threads.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -