Assessing functions performance by compilation
I have done some tests using compiled functions, following the issue in s2dv es/s2dv#15 (closed) and the JIT compiler package https://earth.bsc.es/gitlab/es/requests/-/issues/1311.
The code is in /esarchive/scratch/nperez/git/Flor/s2dverification_tests/Compiled_test.R
test | replications | elapsed | relative | user.self | sys.self |
---|---|---|---|---|---|
2 Comp_.Regression | 10 | 46.083 | 1.028 | 45.998 | 0.079 |
3 Comp_Regression | 10 | 44.818 | 1.000 | 44.806 | 0.008 |
1 Regression | 10 | 44.837 | 1.000 | 44.828 | 0.003 |
For the case in the test, the current version of Regression() in s2dv seems good enough (last line in table).
The compiler could be evaluated in the case of Apply (given results showed by An-Chi in requests issue). It would be useful to use Profvis() to find the bottlenecks.