forked from joejulian/gio
fe2a164d30
The only remaining use of the cache is mapping handles to textures. Using a concrete type for the key avoids the allocation caused by convT. If we need more caches again in the future we can copy the type, or make it generic. Instead of updating the benchmark, we removed it outright. It suffered from several flaws: - The amount of work for each iteration of b.N wasn't constant, because the same cache was reused, growing ever larger in size. - It only tested the cost of insertions. The comment "half are the same and half updated" wasn't true, as calling 'put' with the same key twice would've resulted in a panic. - It didn't simulate any particular workload or cache size, making the benchmark useless for comparing different cache implementations. The cost of insertions isn't particularly interesting. Signed-off-by: Dominik Honnef <dominik@honnef.co>