I know where is the bottleneck. Percentile function is slow. 4800 observations doesn't seems to much to me. May I will try with some other C++ implementation.