Always show game payoffs (with StaticArrays optimization)#223
Always show game payoffs (with StaticArrays optimization)#223zsunberg wants to merge 6 commits intoQuantEcon:mainfrom
Conversation
Eliminates per-cell heap allocation when showing a NormalFormGame. On a 100x100 two-player game, show goes from ~3.5 s / 804 MiB to ~170 ms / 130 MiB.
|
@zsunberg Great, thanks! If we go one step further, we may want to implement (Suppose your 2-arg
|
|
I agree! Especially since the docs say that One minor note: I don't think we need the If you want to take a shot at this, please do (maybe merge #221 into this?). It will be a couple more days before I have time to work on it again. |
This is an improvement on #218
It changes
g[a1,a2]to return anSVectoravoiding allocations.showstill allocates because it has to deal with the string length of the payoff profiles, but the performance is drastically improved over main and #218 (which were about the same when printing the entire game):