BrightSpots / rcv

Ranked Choice Voting Universal Tabulator
Mozilla Public License 2.0
71 stars 19 forks source link

optimize CVR CDF JSON generation #247

Open tarheel opened 5 years ago

tarheel commented 5 years ago

The main thing is that it's not at all scalable to construct the entire map in memory and then write out the JSON. We should use a streaming JSON writer instead, e.g. https://static.javadoc.io/com.google.code.gson/gson/2.6.2/com/google/gson/stream/JsonWriter.html

We might also consider combining the somewhat redundant data structures in CastVoteRecord: winnerToFractionalValue and cdfSnapshotData.

gngilbert commented 5 years ago

Bright Spots call on this. If it is strictly a CDF issue, it can probably wait.