<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Rust4PM: A Versatile Process Mining Library for When Performance Matters</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Aaron Küsters</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Wil M.P. van der Aalst</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Chair of Process and Data Science (PADS), RWTH Aachen University</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Rust4PM provides an open-source software library for process mining focused on performance. For instance, it supports parsing the most common data formats for standard and object-centric event logs (XES and OCEL 2.0) significantly faster than other available process mining tools. The library is written in the compiled, memory safe, programming language Rust, which focuses on performance and explicit error handling. As such, it is a good match for processing huge event data and other computationally expensive tasks or algorithms. Rust4PM aims to form a solid basis for new process mining software that emphasize execution speed or reliability, written in either Rust or another language (e.g., Python, Java, or JavaScript) via the use of appropriate language bindings.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Process Mining</kwd>
        <kwd>Event Data</kwd>
        <kwd>XES Standard</kwd>
        <kwd>Object-Centric Event Data</kwd>
        <kwd>OCEL 2</kwd>
        <kwd>0 Standard</kwd>
        <kwd>Rust</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Features</title>
      <p>The main Rust4PM library is available at https://crates.io/crates/process_mining. It currently
consists of four main modules, covering diferent functionalities.</p>
      <p>
        • The event_log module contains the data structure definitions for the internal
representation of traditional XES event logs. Additionally, it contains a full parser for the XES
2.0 standard, as well as export functionality for exporting event logs to XES. Moreover,
there are case-streaming versions of the importer and exporter available, which allow
processing cases of huge event logs without loading the full file in memory.
• The ocel module contains data structures for the OCEL 2.0 standard for object-centric
event data, as well as import functionality for OCEL 2.0 files in the XML or JSON format.
• The petri_net module consists of data structures for Petri nets, as well as the ability to
import and export basic Petri nets using the Petri Net Markup Language (PNML).
• The alphappp module implements the Alpha+++ process discovery algorithm, which
was the starting point for the Rust implementation, as introduced in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        Moreover, Rust4PM integrates well with other projects. For example, PM4Py optionally
supports importing XES or OCEL 2.0 files via the Rust4PM-based importer rustxes (see [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]).
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Performance Evaluation</title>
      <p>In this section, we present evaluation results for the performance of the XES and OCEL 2.0 XML
parsers, as implemented in Rust4PM, PM4Py and (if available) ProM. For evaluation, we used a
subset of the publicly available BPI Challenge XES event logs (see https://data.4tu.nl/search?
search=BPI+Challenge) as well as OCEL 2.0 logs from https://www.ocel-standard.org/.</p>
      <sec id="sec-3-1">
        <title>BPI_Challenge_2017.xes</title>
        <p>Speedup: 2.27× – 10.86×</p>
      </sec>
      <sec id="sec-3-2">
        <title>BPI Challenge 2018.xes</title>
        <p>Speedup: 2.47× – 2.47×</p>
      </sec>
      <sec id="sec-3-3">
        <title>BPI_Challenge_2019.xes</title>
        <p>Speedup: 2.32× – 12.20×</p>
        <sec id="sec-3-3-1">
          <title>ProM</title>
        </sec>
        <sec id="sec-3-3-2">
          <title>XES Parser</title>
        </sec>
        <sec id="sec-3-3-3">
          <title>Rust4PM</title>
        </sec>
        <sec id="sec-3-3-4">
          <title>ProM</title>
        </sec>
        <sec id="sec-3-3-5">
          <title>XES Parser</title>
        </sec>
        <sec id="sec-3-3-6">
          <title>Rust4PM</title>
        </sec>
        <sec id="sec-3-3-7">
          <title>ProM</title>
        </sec>
        <sec id="sec-3-3-8">
          <title>XES Parser</title>
        </sec>
        <sec id="sec-3-3-9">
          <title>Rust4PM</title>
          <p>angular_github_commits_ocel.xml
Speedup: 16.48×</p>
        </sec>
      </sec>
      <sec id="sec-3-4">
        <title>ContainerLogistics.xml</title>
        <p>Speedup: 32.76×
order-management.xml
Speedup: 41.94×
35
]s30
i[n25
o
tra20
uD15
rse10
a
P 5</p>
        <p>0 PM4Py
]s2.5
[
ion 2
t
rau1.5
D
se 1
raP0.5
0
70
][s60
ion50
tra40
u
D30
e
rs20
a
P10
0 PM4Py
4
]s3.5
i[no 3
ta2.5
ru 2
D
e1.5
rsa 1
P0.5
0
[]s40
n
ito30
a
rD20
u
e
s
ra10
P
0 PM4Py
14
][s12
ino10
tra 8
u
D 6
rse 4
a
P 2
0</p>
        <sec id="sec-3-4-1">
          <title>PM4Py Rust4PM PM4Py Rust4PM PM4Py Rust4PM</title>
        </sec>
        <sec id="sec-3-4-2">
          <title>OCEL2 XML Parser OCEL2 XML Parser OCEL2 XML Parser</title>
          <p>Figure 1: The total import durations for diferent XES and OCEL 2.0 files across the tested
implementations. All configurations were repeated 5 times and the observed standard deviation is included as an
error bar. Missing bars indicate a failed import (e.g., because the program ran out of memory).</p>
          <p>The evaluation results are plotted in Figure 1. For all evaluated XES logs, the Rust4PM
XES parser is at least two times faster on average than the other tested implementations.
In comparison to PM4Py specifically, speedups of at least 10 times were observed for all
evaluated XES event logs. For OCEL 2.0 XML, Rust4PM also significantly outperforms the PM4Py
implementation by a factor of at least 15 for all evaluated files. As of now, no implementation
of the new 2.0 version of the OCEL standard is available in ProM.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Use Cases: Example Projects and Architecture Recipes</title>
      <p>In this section, we present four example applications built using the main Rust4PM library
as a base. Figure 2 shows screenshots of the tools. Each application is based on a diferent
architecture and usage context. Additionally, each application focuses on a specific feature
set of the Rust4PM library. Thus, these examples do not follow a common theme, but should
instead demonstrate the versatility of using Rust4PM in diferent contexts and architectures.
(a) log_strip
(b) event_hours_analyzer
(c) ocel_graph
(d) petri_net_wasm</p>
      <p>
        Next, we will shortly describe each demo application, mentioning the used architecture and
leveraged library features. All examples are also publicly available at https://github.com/aarkue/
rust4pm_demos, together with a demo video on Rust4PM as a whole, as well as these examples.
4.1. CLI for Stripping XES Attributes (log_strip)
The Rust command-line-interface (CLI) program log_strip can strip or modify certain
attributes from an input XES event log, resulting in a stripped output log. A typical application
for such a tool lays in privacy-preserving process mining, as presented in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. In particular, this
tool removes all top-level log attributes, all case level attributes besides concept:name and
all event-level attributes apart from concept:name and time:timestamp. Additionally, the
second and nanosecond portion of the event timestamp is removed (i.e., set to 0), reducing the
timestamp precision.
      </p>
      <p>The tool uses the XES trace stream importer and exporter from Rust4PM. Thus, the CLI can
also be used to modify event logs which are too large to fit in system memory.
4.2. Python Script for Data Visualization (event_hours_analyzer)
event_hours_analyzer is a Python Jupyter notebook for visualizing the number of events
per hour of the day based on an input event log. The computationally expensive parts, i.e., the
import of the XES event log and the computation of the event counts, are implemented in Rust.
This functionality is then exposed as a Python library, which is used in the Jupyter notebook.</p>
      <p>In this example, the XES importer and the event log data structures provided by the Rust4PM
library are used.
4.3. Web Service for Constructing Graphs from OCED (ocel_graph)
This demo application is implemented as a web server backend implemented in Rust, which
uses Rust4PM, and an interactive web-based frontend. The backend allows loading OCEL 2.0
event data and constructing graphs based on an event or object in the input data. In particular,
all event-to-object and object-to-object relationships inside the object-centric event log are
recursively expanded, based on specified parameters (e.g., the maximal number of recursion
steps). The resulting interactive graph contains the encountered events and objects of the OCEL
as nodes and edges between nodes corresponding to the relationships in the OCEL.</p>
      <p>The backend utilizes the OCEL 2.0 XML or JSON import functionality of Rust4PM, as well as
the OCEL 2.0 data structure representation to construct the graph.
4.4. Petri Net Editor with PNML and Discovery Support via WASM
(petri_net_wasm)
This example application is a basic client-side Petri net editor. While the main editor is
implemented using web technologies, it leverages the PNML import and export functionality
from Rust4PM. Additionally, it allows discovering Petri nets from XES event logs based on the
implementation of the Alpha+++ process discovery algorithm and the XES parser in Rust4PM.
For that, the corresponding functions are exposed via WebAssembly (WASM), which is a possible
compilation target for Rust. In contrast to the web server example presented before, WASM runs
directly in the web browser of the user. We include this example specifically to demonstrate
running Rust4PM in the web browser, which allows users to try out or use a tool simply by
visiting a website, without the need to install anything on their machine.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>In this paper, we introduced the performance-centric Rust4PM software project. Among other
features, the main library supports importing the most common traditional and object-centric
event data file formats, XES and OCEL 2.0. Through streaming XES traces, it also supports
importing, processing and exporting huge XES event logs that would otherwise not fit into
system memory. We evaluated the performance of the XES and OCEL 2.0 XML import parsers
between two other popular open-source solutions, ProM and PM4Py, and observed significantly
improvements in import speeds for all considered configurations, with speedups factors ranging
from 2 to 40. To demonstrate the flexibility of Rust4PM, we presented four example applications,
each with an own software architecture and feature focus.</p>
      <p>Maturity The main Rust4PM library was first published in December 2023 with rudimentary
features, and received more than 25 version updates since then. In this time, it was downloaded
more than 10,000 times in total, according to crates.io. There are around 40 software test cases
included, which cover a large portion of the implemented features. However, as the project is
still rather young, there will likely still be changes to the exposed API surface in the future.
Future work There are still plenty of interesting features to be implemented in the library.
For example, export support for OCEL 2.0, or the implementation of computationally expensive
process mining algorithms, such as the computation of alignments. Furthermore, there are
many possible advancements for the example applications presented in Section 4.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>B. F. van Dongen</given-names>
            ,
            <surname>A. K. A. de Medeiros</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. M. W.</given-names>
            <surname>Verbeek</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. J. M. M. Weijters</surname>
            ,
            <given-names>W. M. P. van der Aalst</given-names>
          </string-name>
          ,
          <article-title>The ProM Framework: A New Era in Process Mining Tool Support</article-title>
          , in: G. Ciardo, P. Darondeau (Eds.),
          <source>Applications and Theory of Petri Nets</source>
          <year>2005</year>
          , 26th International Conference, ICATPN 2005,
          <article-title>Miami</article-title>
          , USA, June 20-25,
          <year>2005</year>
          , Proceedings, volume
          <volume>3536</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2005</year>
          , pp.
          <fpage>444</fpage>
          -
          <lpage>454</lpage>
          . URL: https://doi.org/10.1007/11494744_25. doi:
          <volume>10</volume>
          .1007/11494744\_
          <fpage>25</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Berti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. J. van Zelst</given-names>
            ,
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          ,
          <article-title>Process Mining for Python (PM4Py): Bridging the Gap Between Process-</article-title>
          and
          <string-name>
            <surname>Data Science</surname>
          </string-name>
          , CoRR abs/
          <year>1905</year>
          .06169 (
          <year>2019</year>
          ). URL: http://arxiv.org/abs/
          <year>1905</year>
          .06169. arXiv:
          <year>1905</year>
          .06169.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Küsters</surname>
          </string-name>
          ,
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          ,
          <article-title>Developing a High-Performance Process Mining Library with Java and Python Bindings in Rust</article-title>
          ,
          <source>CoRR abs/2401</source>
          .14149 (
          <year>2024</year>
          ). URL: https://doi.org/ 10.48550/arXiv.2401.14149. doi:
          <volume>10</volume>
          .48550/ARXIV.2401.14149. arXiv:
          <volume>2401</volume>
          .
          <fpage>14149</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Rafiei</surname>
          </string-name>
          ,
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          ,
          <article-title>Privacy-Preserving Data Publishing in Process Mining</article-title>
          , in: D.
          <string-name>
            <surname>Fahland</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Ghidini</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Becker</surname>
          </string-name>
          , M. Dumas (Eds.),
          <source>Business Process Management Forum - BPM Forum</source>
          <year>2020</year>
          , Seville, Spain,
          <source>September 13-18</source>
          ,
          <year>2020</year>
          , Proceedings, volume
          <volume>392</volume>
          <source>of Lecture Notes in Business Information Processing</source>
          , Springer,
          <year>2020</year>
          , pp.
          <fpage>122</fpage>
          -
          <lpage>138</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -58638-
          <issue>6</issue>
          _8. doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>030</fpage>
          -58638-6\_8.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>