The farebox recovery ratio in many western nations are not enough to ever fully fund public transport. In many cases, the systems to collect fares end up costing hundreds of millions of dollars. These costs are never made back. It makes sense to make it free.
> The farebox recovery ratio in many western nations are not enough to ever fully fund public transport.
True, with emphasis on fully.
> In many cases, the systems to collect fares end up costing hundreds of millions of dollars.
That figure seems extremely high for "many cases," but the exact figure isn't really material.
> These costs are never made back. It makes sense to make it free.
No, that's just not true.
My local metro spent $17 million on fare collection to net $167 million in revenue (2019). It would have to cut $150 million in other service to go to free fares.
The calculation is not that simple, though. One expected effect is less car rides, which would require less car infrastructure and maintenance. That would also result in significant savings, car infrastructure is expensive.
Maybe in some holistic view of spending, but that isn't the reality of transit agency budgets. If transit saves DOT $50M, it doesn't go into transit's budget.
I believe Bryant and O'Hallaron wrote a text book just for this course. You can always "optimize" it by reverse engineering the benchmark app and providing the correctly aligned blocks to the bench-marking application. It'll beat the standard malloc calls by several magnitudes if you were to do that.
This is one of the reasons why people write custom allocators - to suit a specific purpose where the allocation pattern is known well in advance.