Economies and diseconomies of scale in on-demand ridepooling systems