Significantly faster calculation engine is a post by HOnza in the 'Ideas' section of the Claris community. Many FM-based applications would greatly benefit from a faster calc engine. If you agree, please go there and vote for it.
Be aware that you would have to deal with the consequences.
JavaScript is faster as it uses a Just in Time Compiler to create machine code.
And it optimizes code and does some optimization to get more performance.
And for all numeric operations, it uses double data type, which is not as precise as the math done by FileMaker with exact precision.
Any change in the calculation engine may break a lot of code and should not change any behavior. So I welcome a speed improvement, but I fear any change may break things.
Yes, breaking code is a no-go. I wonder if there is a way to achieve improvement without adverse effects.
Great point to note.
but the CPU does predictive branching all the time, including when doing calculation engine in FileMaker!?
If Claris wants to do something, they would get something like 10 heavy examples doing some benchmark. Then sample with Instruments on a Mac what is taking most times and look into their C routines to see if something can be optimized.
I would expect a few things may be optimized:
- Optimize math routines to optimize integer values in normal int range to use an int and not the normal math engine.
- Optimize $a = $a & $b, where you would check if you can just append directly to the buffer for $a instead of copying to a new value.
- Check to see if while() upper bound check can be optimized if the calculation doesn't change to avoid it being recalculated for each iteration.
- Have optimized compare code paths for comparing with zero or empty text.
anyway, I would offer help if Claris likes input from outside.