Skip to main content

STAMP-Rust: Language and Performance Comparison to C on Transactional Benchmarks

  • 242 Accesses

Part of the Lecture Notes in Computer Science book series (LNCS,volume 13852)


Software Transactional Memory has been used as a synchronization mechanism that is easier to use and compose than locking ones. The mechanisms continued relevance in research and application design motivates considerations regarding safer implementations than existing C libraries. In this paper, we study the impact of the Rust programming language on STM performance and code quality. To facilitate the comparison, we manually translated the STAMP benchmark suite to Rust and also generated a version using a state-of-the-art C-to-Rust transpiler. We find that, while idiomatic implementations using safe Rust are generally slower than both C and transpiled code, they guarantee memory safety and improve code quality.


  • Software Transactional Memory
  • Memory Safety
  • Parallelism

This project is partially funded by the EU Horizon 2020 Programme under grant agreement No 957269 (EVEREST).

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions


  1. 1.

    Closures in Rust are comparable to Lambda functions in other languages. They can have arguments and capture variables from the outside context. The implications of the latter are not relevant for this paper.

  2. 2.

    The code base for the original STAMP applications can be found on

  3. 3.

  4. 4.

    This internally uses an atomically reference-counted pointer. When a new value is written by another transaction, the TVars internal pointer is replaced, not changing the contents of the shared pointer.


  1. Anderson, B., et al.: Engineering the servo web browser engine using Rust. In: Proceedings of the 38th International Conference on Software Engineering Companion, pp. 81–89. ACM, Austin Texas (2016).

  2. Astrauskas, V., Müller, P., Poli, F., Summers, A.J.: Leveraging rust types for modular specification and verification. Proc. ACM Program. Lang. 3(OOPSLA), 1–30 (2019).

  3. Bader, D.A., Madduri, K.: Design and implementation of the HPCS graph analysis benchmark on symmetric multiprocessors. In: Bader, D.A., et al. (eds.) HiPC 2005. LNCS, vol. 3769, pp. 465–476. Springer, Heidelberg (2005).

    CrossRef  Google Scholar 

  4. Balasubramanian, A., Baranowski, M.S., Burtsev, A., Panda, A., Rakamarić, Z., Ryzhyk, L.: System programming in rust: beyond safety. In: Proceedings of the 16th Workshop on Hot Topics in Operating Systems, pp. 156–161. ACM, Whistler (2017).

  5. Beadle, H.A., Cai, W., Wen, H., Scott, M.L.: Nonblocking persistent software transactional memory. In: 2020 IEEE 27th International Conference on High Performance Computing, Data, and Analytics (HiPC), pp. 283–293. IEEE, Pune(2020).,

  6. Bergmann, G.: Software Transactional Memory (2022). original-date: 2015-09-15T14:45:14Z

  7. Blandy, J., Orendorff, J.: Programming Rust: Fast, Safe Systems Development. O’Reilly Media, Sebastopol, first edition edn. (2017). oCLC: on1019128949

    Google Scholar 

  8. Boyapati, C., Lee, R., Rinard, M.: Ownership types for safe programming: preventing data races and deadlocks. In: Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications - OOPSLA 2002, p. 211. ACM Press, Seattle(2002).,

  9. Boyapati, C., Salcianu, A., Beebee, W., Rinard, M.: Ownership types for safe region-based memory management in real-time Java. In: Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation - PLDI 2003, p. 324. ACM Press, San Diego (2003).,

  10. Bychkov, A., Nikolskiy, V.: Rust language for supercomputing applications. In: Voevodin, V., Sobolev, S. (eds.) RuSCDays 2021. CCIS, vol. 1510, pp. 391–403. Springer, Cham (2021).

    CrossRef  Google Scholar 

  11. Minh, C. C., Chung, J., Kozyrakis, C., Olukotun, K..: STAMP: Stanford transactional applications for multi-processing. In: 2008 IEEE International Symposium on Workload Characterization, pp. 35–46. IEEE, Seattle (2008).,

  12. Contributors, C.: C2Rust (2022). original-date: 2018-04-20T00:05:50Z

  13. Correia, A., Felber, P., Ramalhete, P.: Romulus: efficient algorithms for persistent transactional memory. In: Proceedings of the 30th on Symposium on Parallelism in Algorithms and Architectures, pp. 271–282. ACM, Vienna Austria (2018).

  14. Dice, D., Shalev, O., Shavit, N.: Transactional locking II. In: Hutchison, D., et al. (eds.) DISC 2006. LNCS, vol. 4167, pp. 194–208. Springer, Heidelberg (2006).

    CrossRef  Google Scholar 

  15. Dragojević, A., Harris, T.: STM in the small: trading generality for performance in software transactional memory. In: Proceedings of the 7th ACM European Conference on Computer Systems - EuroSys 2012, p. 1. ACM Press, Bern (2012).,

  16. Emre, M., Schroeder, R., Dewey, K., Hardekopf, B.: Translating C to safer Rust. Proc. ACM Program. Lang. 5(OOPSLA), 1–29 (2021).

  17. Guerraoui, R., Kapalka, M., Vitek, J.: STMBench7: a benchmark for software transactional memory (2006).

  18. Haagdorens, B., Vermeiren, T., Goossens, M.: Improving the performance of signature-based network intrusion detection sensors by multi-threading. In: Hutchison, D., et al. (eds.) WISA 2004. LNCS, vol. 3325, pp. 188–203. Springer, Heidelberg (2005).

    CrossRef  Google Scholar 

  19. Herlihy, M., Moss, J.E.B.: Transactional memory: architectural support for lock-free data structures. In: Proceedings of the 20th Annual International Symposium on Computer Architecture - ISCA 1993, pp. 289–300. ACM Press, San Diego (1993).,

  20. Holk, E., Pathirage, M., Chauhan, A., Lumsdaine, A., Matsakis, N.D.: GPU programming in rust: implementing high-level abstractions in a systems-level language. In: 2013 IEEE International Symposium on Parallel & Distributed Processing, Workshops and PHD Forum, pp. 315–324. IEEE, Cambridge (2013).,

  21. Jung, R., Jourdan, J.H., Krebbers, R., Dreyer, D.: RustBelt: securing the foundations of the Rust programming language. Proc. ACM Program. Lang. 2(POPL), 1–34 (2018).

  22. Kulkarni, M., Pingali, K., Walter, B., Ramanarayanan, G., Bala, K., Chew, L.P.: Optimistic parallelism requires abstractions. In: Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation - PLDI 2007, p. 211. ACM Press, San Diego (2007).,

  23. Lee, C.Y.: An algorithm for path connections and its applications. IEEE Trans. Electron. Comput. EC 10(3), 346–365 (1961).

    CrossRef  MathSciNet  Google Scholar 

  24. Levy, A., et al.: Ownership is theft: experiences building an embedded OS in rust. In: Proceedings of the 8th Workshop on Programming Languages and Operating Systems, pp. 21–26. ACM, Monterey California (2015).

  25. Levy, A., Campbell, B., Ghena, B., Pannuto, P., Dutta, P., Levis, P.: The case for writing a kernel in rust. In: Proceedings of the 8th Asia-Pacific Workshop on Systems, pp. 1–7. ACM, Mumbai (2017).

  26. Macqueen, J.: Some methods for classification and analysis of multivariate observations. In: In 5-th Berkeley Symposium on Mathematical Statistics and Probability, pp. 281–297 (1967)

    Google Scholar 

  27. Pasqualin, D.P., Diener, M., Du Bois, A.R., Pilla, M.L.: Online sharing-aware thread mapping in software transactional memory. In: 2020 IEEE 32nd International Symposium on Computer Architecture and High Performance Computing (SBAC-PAD), pp. 35–42. IEEE, Porto (2020).,

  28. Paznikov, A., Smirnov, V., Omelnichenko, A.: Towards efficient implementation of concurrent hash tables and search trees based on software transactional memory. In: 2019 International Multi-Conference on Industrial Engineering and Modern Technologies (FarEastCon), pp. 1–5. IEEE, Vladivostok, (2019).,

  29. Pop, M., Salzberg, S., Shumway, M.: Genome sequence assembly: algorithms and issues. Computer 35(7), 47–54 (2002).,

  30. Ramalhete, P., Correia, A., Felber, P.: Efficient algorithms for persistent transactional memory. In: Proceedings of the 26th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp. 1–15. ACM, Virtual Event Republic of Korea (2021).

  31. Scott, M.L., Spear, M.F., Dalessandro, L., Marathe, V.J.: Transactions and privatization in delaunay triangulation. In: Proceedings of the Twenty-sixth Annual ACM Symposium on Principles of Distributed Computing - PODC 2007. p. 336. ACM Press, Portland (2007).,

  32. Takano, K., Oda, T., Kohata, M.: Design of a DSL for converting rust programming language into RTL. In: Barolli, L., Okada, Y., Amato, F. (eds.) EIDWT 2020. LNDECT, vol. 47, pp. 342–350. Springer, Cham (2020).

    CrossRef  Google Scholar 

  33. Tasharofi, S., Dinges, P., Johnson, R.E.: Why do scala developers mix the actor model with other concurrency models? In: Castagna, G. (ed.) ECOOP 2013. LNCS, vol. 7920, pp. 302–326. Springer, Heidelberg (2013).

    CrossRef  Google Scholar 

  34. Xu, Y., Izraelevitz, J., Swanson, S.: Clobber-NVM: log less, re-execute more. In: Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 346–359. ACM, Virtual USA (2021).

Download references


The authors would like to thank Sebastian Ertel for his valuable input.

Author information

Authors and Affiliations


Corresponding author

Correspondence to Felix Suchert .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Suchert, F., Castrillon, J. (2023). STAMP-Rust: Language and Performance Comparison to C on Transactional Benchmarks. In: Gainaru, A., Zhang, C., Luo, C. (eds) Benchmarking, Measuring, and Optimizing. Bench 2022. Lecture Notes in Computer Science, vol 13852. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-31179-6

  • Online ISBN: 978-3-031-31180-2

  • eBook Packages: Computer ScienceComputer Science (R0)