Does Callable Program hurt the performance much?

Hi everyone, currently I am trying to make my path tracer faster. I use a lot of Callable Programs in my application, for Camera models and Materials. For example, I use only one closest hit program for all materials, the BSDF evaluation and sampling are implemented as callable programs. I have tried to expand the BSDF evaluation and sampling code into the closest hit program, and found that there was almost no speed improvement. So it seems that I can use Callable Program excessively and don’t need to worry about its performance penalty?

Callable programs might require some register saving/restoring but aside from that they’re pretty fast. If you want to measure their performances you might start taking a look at the shadeTree sample in the SDK

Thanks! It turns out that Callable Program is not the bottle neck in my code.