Utility package for CPI and other inflators.
<- rep_len(fy::yr2fy(1999:2020), 1e7)
x
system_time(grattan::cpi_inflator(, x, "2019-20"))
## process real
## 531ms 482ms
system_time(cpi_inflator(x, "2019-20"))
## process real
## 438ms 439ms
system_time(cpi_inflator(x, "2019-20", nThread = 4L))
## process real
## 391ms 114ms
<- dqrng::dqsample(x)
y system_time(grattan::cpi_inflator(, x, y))
## process real
## 24.3s 21.1s
system_time(cpi_inflator(x, y, nThread = 4L))
## process real
## 984ms 241ms
<- rep_len(x, 1e8)
x system_time(cpi_inflator(x, "2019-20", nThread = 4L))
## process real
## 4.61s 1.25s
<- y <- NULL x
<- seq(as.Date("1999-01-01"), as.Date("2020-01-01"), by = "1 day")
x <- rep_len(x, 1e7)
x system_time(cpi_inflator(x, "2019-01-01"))
## process real
## 297ms 311ms
<- rep_len(x, 1e8)
x system_time(cpi_inflator(x, "2019-01-01", nThread = 4L))
## process real
## 3.67s 1.29s
<- as.IDate(x)
x system_time(cpi_inflator(x, as.IDate("2019-01-01"), nThread = 4L))
## process real
## 2.66s 905.37ms