Home > Net >  Is there a significant performance gap bewteen native VulkanSDK and its C binding?
Is there a significant performance gap bewteen native VulkanSDK and its C binding?

Time:11-01

Recently I'm trying to learn vulkan, and I found that although nearly every tutorial or book I found teaches vulkan with C , the API style of it is more C than C . Naturally, I looked for its official C API, and that raised my question:

Is there a significant performance gap bewteen native VulkanSDK and its C binding? Or more generally, is there a significant performance gap bewteen C library and its C binding?

CodePudding user response:

No

C and C compilers and linkers are both well optimized at this point of life.

Generally speaking - performance of code is the result of the whole programming process - from the initial design, to the programmer that codes, to the last step in the CI for deployment. So in general - are C bindings faster than C ? No.

About Vulkan - It's a low level library, the bindings themselves have no much difference.
The usage is very important since Vulkan is considered more "Low level" than OpenGL - this results in more control of the buffers and overall program flow.
Memory,IO, CPU, Graphics RAM are all controlled by the developer which is the main concern for performance.

Standard libraries are important

C header files and C STD may differ in implementation which is the biggest point to consider when choosing a language - What does the ecosystem provide you as a programmer?.
Since you'll probably need some vectors and matrix structures and a good math library for game development.
This may affect your choices.

Benchmark and metrices

Nothing is written in stone.
If you are concerned with performance first thing you'll need is to measure it.
And that's a great exercise you can do - Are C bindings faster than C ?
Just use a benchmark in your application and test it yourself!

Best of luck.

  • Related