Compartmentalization is vital for cell biological processes. The field of rule-based stochastic simulation has acknowledged this, and many tools and methods have capabilities for compartmentalization. However, mostly, this is limited to a static compartmental hierarchy and does not integrate compartmental changes. Integrating compartmental dynamics is challenging for the design of the modeling language and the simulation engine. The language should support a concise yet flexible modeling of compartmental dynamics. Our work is based on ML-Rules, a rule-based language for multi-level cell biological modeling that supports a wide variety of compartmental dynamics, whose syntax we slightly adapt. To develop an efficient simulation engine for compartmental dynamics, we combine specific data structures and new and existing algorithms and implement them in the Rust programming language. We evaluate the concept and implementation using two case studies from existing cell-biological models. The execution of these models outperforms previous simulations of ML-Rules by two orders of magnitude. Finally, we present a prototype of a WebAssembly-based implementation to allow for a low barrier of entry when exploring the language and associated models without the need for local installation.Author summaryBiochemical dynamics are constrained by and influence the dynamics of cellular compartments. Basic constraints are considered by many modeling and simulation tools, e.g., certain reactions may only occur in specific cellular compartments and at a speed influenced by the compartmental volume. However, to capture the functioning of complex compartmental dynamics such as cell proliferation or the fission or fusion of mitochondria, additional efforts are required from tool designers. These refer to how the modeler can specify these dynamics succinctly and unambiguously and how the resulting model can be executed efficiently. For modeling, we rely on ML-Rules, an expressive, formal rule-based language for modeling biochemical systems, which ships with the required features and which we only slightly adapt in our re-implementation. We design a new simulation engine that combines efficient data structures and various algorithms for efficient simulation. The achieved efficiency will enable thorough analysis, calibration, and validation of compartmental dynamics and, thus, allow the “in-silico” pursuit of research questions for which compartmental dynamics are essential. To further facilitate exploring the interplay of compartmental and non-compartmental dynamics, we exploit recent advances in web technology so that ML-Rules models can be run efficiently in the web browser.