Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve docstrings
  • Loading branch information
EdmundGoodman committed Jul 23, 2025
commit 562593a8984c3dc8a39eb47ab6fa896f0920f114
15 changes: 15 additions & 0 deletions pyperformance/data-files/benchmarks/bm_xdsl/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
``get_constant_folding_module()`` function, which is then transformed by the
``xdsl.transforms.test_constant_folding.TestConstantFoldingPass`` xDSL
transformation pass.

xDSL is a Python-native compiler framework built around SSA-based intermediate
representations. It re-implements many of MLIR's data structures and methods in
Python. This benchmark exercises the simple pattern rewriting transformation of
constant folding. This is a fair proxy for pattern rewriting transformations in
general, which are a major component of MLIR-like compilers in lowering passes.

Pattern rewriting in both xDSL and MLIR is a pointer-chasing, unstructured
workload, which makes it hard to optimise ahead-of-time. This diminishes the
traditional performance advantage of ahead-of-time compiled languages such as
C++ over dynamic languages such as Python -- making it an interesting benchmark.
More information about the design and impact of this benchmark can be found in
the Master's thesis ``Performance and Dynamism in User-extensible Compiler
Infrastructures'', which is `available on GitHub
<https://github.com/EdmundGoodman/masters-project>`_.
"""

import random
Expand Down