-
Notifications
You must be signed in to change notification settings - Fork 0
Description
BinaryMatrixPlayer/BinaryMatrixEngine/CardList.cs
Lines 7 to 14 in 325aa5b
/* TODO?: Do an optimization pass over this? | |
* We could take advantage of the unique nature of literally *every single list* here. | |
* Combat Stacks: Filled one at a time, then rapidly emptied. (Defender stack might have some leftovers.) | |
* Lane Decks/Attacker Deck: Drained one at a time, then rapidly refilled. | |
* Discard Piles: Filled slowly, then rapidly emptied. | |
* | |
* (honestly optimizing this doesn't matter except for rapidly simulating games, so this is more of an academic thing) | |
*/ |
This comment was written before CardList::MoveAllTo
was introduced and at a time that CardList::TakeFirst
still had usages -- as such, this may be outdated. Running some benchmarks would still be good here, I think. (Particularly to figure out if this is even an area that needs attention!)
BinaryMatrixPlayer/BinaryMatrixEngine/CardList.cs
Lines 28 to 29 in 325aa5b
/* TODO?: Profile array pool usage to get a sense of some better parameters here. */ | |
private static readonly ArrayPool<Card> listPool = ArrayPool<Card>.Create(8, 32); |
(calls ArrayPool::Create(int maxArrayLength, int maxArraysPerBucket)
)
Some simple benchmarking and tracking of average list lengths, along with free/used;reused/newly allocated stats would be good here. These parameters were arbitrarily chosen by a neural network (read: I made them up) instead of any hard data.