Benchmarking Data Collector Strategies mesa-frames #168
Replies: 2 comments 3 replies
-
Cool! Can you elaborate a bit on the async flush and deferred flush. Specifically, can you give some technical details or code examples so I can wrap my head around it. It would be cool to test this with normal mesa at some point as well. |
Beta Was this translation helpful? Give feedback.
-
Great job on the comprehensive analysis, Ben! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We benchmarked different data collection + flushing strategies on the Boltzmann Wealth Model (100 steps) with up to 1M agents.
The goal was to evaluate trade-offs between execution time, memory usage, and CPU utilization for each approach.
🔬 Data Collector Strategies Compared
mesa-frames (pl native)
Default mesa-frames run with no data collection.
mesa-frames (pl native) with data collector Collects every step CSV
Collects data every step and immediately flushes to a CSV file.
mesa-frames (pl native) with data collector Collects every 10th step CSV
Collects data every 10th step and immediately flushes to a CSV file.
mesa-frames (pl native) with data collector Collects every step in Memory
Collects every step but does not flush, instead keeps everything in memory.
mesa-frames (pl native) with data collector Collects every step with deffered flush CSV
Collects every step and flushes every 100 steps (without concatenation, flushes files one by one).
mesa-frames (pl native) with data collector Collects every step with custom Deffered Flush
Collects every step and flushes every 100 steps (after concatenation).
mesa-frames (pl native) with data collector Collects every step in parquet
Collects every step and flushes as a Parquet file.
mesa-frames (pl native) with data collector Collects every step with async Flush
Collects every step and flushes asynchronously.
Plots
📊 Results Summary
Execution Time
Memory Usage
CPU Utilization
✅ Conclusion
After evaluating runtime, memory, and CPU trade-offs, we decided to adopt:
➡️
mesa-frames (pl native) with data collector Collects every step with async Flush
Even though it consumes more memory, the significant reduction in execution time and high CPU utilization make Async Flush the best choice overall.
The performance gains outweigh the additional memory cost, especially for large-scale runs with
mesa-frames (pl native)
.Beta Was this translation helpful? Give feedback.
All reactions