slang
slang copied to clipboard
[CI Strategy] Reuse graphics device in slang-test over multiple tests
From a quick profiling, it appears that roughly 40% of the CPU time is spent in a function, SlangResult _createDevice(const IDevice::Desc* desc, IDevice** outDevice)
, while running slang-test.
It creates a device for the target platform such as D3D12, D3D11, VKDevice, Cuda and CPU.
We may be able to reused the device over multiple tests rather than creating and destroying it for each and every test.
The idea is to create those devices only once for each and keep reusing them. This is expected to improve the total runtime of slang-test. I suspect that the device creating might have been a bottleneck when we run multiple processes of slang-test. And it may improve the total runtime by more than 40%.
I also suspect that creating and destroying the devices too frequently might have been the cause of the instability of slang-test in the past. If we don't frequently create the devices, it may improve the stability as well.