Replies: 8 comments 24 replies
-
In what ways would this make customizations more difficult? |
Beta Was this translation helpful? Give feedback.
-
Adding that the Cythonized version would make Mesa to be within the order of magnitude of Agents.jl's performance, instead of an order of magnitude slower. At least in a hybrid Python-Cython version, and could be further faster in a full Cython version. |
Beta Was this translation helpful? Give feedback.
-
Another possibility that hasn't been explored yet is to run Mesa models with Agents.jl backend. In order to be fast, it would require transpiling the model to Julia objects all at once, instead of having Python objects that constantly get converted to Julia objects. |
Beta Was this translation helpful? Give feedback.
-
Opening a separate thread for Rust:
Needs an example of a scientific Python library that uses Rust under the hood. One that came to my mind is rustworkx, a faster NetworkX. |
Beta Was this translation helpful? Give feedback.
-
Although I am a bit late to join the discussion, I have a question: Is Mesa truly slow? While I acknowledge that it may be slower than Agents.jl by several orders of magnitude, I wonder if this necessarily implies that it is inherently slow. Considering that Mesa as a framework does not perform extensive operations, I am genuinely curious about the significance of performance in justifying some of the approaches being discussed here. In a reasonably complex model, what percentage of time is actually spent on executing Mesa code? Additionally, to the best of my knowledge, there haven't been any open issues complaining about Mesa's performance. There may have been one or two cases where people wanted to simulate millions of agents, but this approach is not feasible even if the performance were to increase significantly. Therefore, I fail to see the need to overly complicate Mesa's code. However, I am open to hearing any concrete evidence of situations where Mesa's performance has hindered simulations. |
Beta Was this translation helpful? Give feedback.
-
Based on @Corvince's comment, what specific measurable problem are we trying to solve here? |
Beta Was this translation helpful? Give feedback.
-
I think, in 2024, we will instead port the slow parts of Mesa into Rust. And if possible, allow users to write fast code like they do in Polars. I have done Rust experiments in #2042. It absolutely can do NumPy array memoryview manipulation, at a cost of slightly more verbose code. Using Rust |
Beta Was this translation helpful? Give feedback.
-
The use case I have in mind is running mesa simulation in a Python shinylive app in a quarto blog which uses pyodide to convert python to webassembly in the browser. It requires a pure Python package. Ideally, we should have an installation options mesa[core], mesa[full] etc. |
Beta Was this translation helpful? Give feedback.
-
Mesa is working to make Mesa faster. To do this our developers @rht and @Tortar have built a cython version of space.py that gives variety of speed ups.
The question, should the cython version be part of standard Mesa as the default build or should it be a different install?
Costs and Benefits:
21 votes ·
Beta Was this translation helpful? Give feedback.
All reactions