HughParsonage / grattan

Common quantitative tasks for Australian policy analysts
25 stars 8 forks source link

Avoid expensive switching between integer and double types #178

Open HughParsonage opened 5 years ago

HughParsonage commented 5 years ago

For various reasons (e.g. fidelity with the actual tax calculations which use integers, not fractional components; or because of conversion via Rcpp), there is quite a lot of conversion between integer types and double types in income_tax and model_income_tax. This slows down the computations a little and could potentially be avoided. See hutilscpp::pmaxC and friends for compatible versions which avoid the performance hit.