Extra Benefit of Modern C++ to Edge computing
how compile-time programming help accelerate the run-time?
One of key features in modern C++ is the introduction of compile-time programming — compiler is able to make evaluation(for constexpr variable) and deduction (for type or function) during compilation. So, how edge computing could benefit from this feature? In this post, I came up with a simple example to elucidate the benefit of compile-time programming to edge computing?
How compile-time programming help edge computing ?
Since code could be cross-compiled in more powerful computer at computing center, the compiled executable can later be deployed into edge device w/ less computational power.
Therefore, I came up w/ a simple demo code to test the run-time w/ or w/o the help of compile-time pre-calculation.
Test result is shown as follow:
W/ calculation in compile-time, time(msec): 3.302e-05
W/o calculation in compile-time, time(msec): 2.183
As shown above, run time w/ the help of compile-time pre-calculation is faster than that w/o pre-calculation by 5 order of magnitude!!