A script in C or C ++ could write algorithms on Lua (by brute force , that is, test several possible combinations) based on a database with algorithm results.
The idea is to arrive at the most efficient algorithm for a given goal, for example, I developed an algorithm for calculating statistics, I want to get to a more efficient one without losing focus.
Is there any library or way to test the speed of a code in Lua or C / C ++ using C ++?