Original motivation:
“card.card_stats_data() became slow after Feat/forgetting curve in card info by L-M-Sherlock · Pull Request #3437 · ankitects/anki · GitHub because it computes the memory state for each revlog. For card with 40+ revlogs, it costs ~400ms to return the result. It’s not perceivable when opening the card info page. But it slows down add-ons which use card_stats_data() to get the revlogs of thoustands of cards significantly.”
Of course it would be preferable to refactor the existing calculation method while reducing the computational complexity to O(n).




