Does MicroPython have constant evaluation (folding)?
Posted: Mon Mar 25, 2019 2:13 pm
Hello
Does MicroPython support constant evaluation of functions when they get compiled to bytecode? Let's assume I compile a C-string which calls a function with an integer argument (so something like "f(42)") to bytecode and then execute it, is there any chance that the result of that call is pre-calculated?
For some reason my benchmark currently tells me that the MicroPython version of that function is about ~250 times faster than the native C version... ?
thanks
Does MicroPython support constant evaluation of functions when they get compiled to bytecode? Let's assume I compile a C-string which calls a function with an integer argument (so something like "f(42)") to bytecode and then execute it, is there any chance that the result of that call is pre-calculated?
For some reason my benchmark currently tells me that the MicroPython version of that function is about ~250 times faster than the native C version... ?
thanks