PRESENTATION

01 / 13

Rust - fast business logic

Silen Locatelli

ERNI

30.09.2026

PRESENTATION

02 / 13

PRESENTATION

03 / 13

Rust - fast business logic

  1. What do I mean by "fast"
  2. Abstraction layers
  3. Comparison with the JVM
  4. What to look out for
  5. Feasibility
  6. Rule of thumb
  7. Some sort of proof

PRESENTATION

04 / 13

Abstraction Layers

There is no single layer. Abstraction is just a stack between you and the hardware:

Abstracting is a real concern and we can not ignore it when we talk about languages.

Paper

PRESENTATION

05 / 13

What do I mean by "fast"

Things I have heard:

  • Real Time
  • Instant
  • In milliseconds
  • Human reaction time
  • Fast enough
  • The database is anyway slow
  • 80/20 rule

PRESENTATION

06 / 13

What do I mean by "fast"

When talking about languages

  • At the hardware level -> Optimizations
  • Assembly -> Instructions
  • LLVM / Virtual Machine -> Intermediate Representation/Target
  • Logic -> How easy is it to write something performant
  • Standard Library -> Do we have to rewrite parts?
  • Ideas -> Pivoting to new ideas
  • How well can we measure performance? -> Control and Iteration
  • Ecosystem -> Do people care?

PRESENTATION

07 / 13

Java

  • At the hardware level -> Optimizations -> Yes but not easy to control
  • Assembly -> Instructions -> possible but not easy
  • LLVM / Virtual Machine -> Intermediate Representation/Target -> One of best optimized for the JVM
  • Logic -> How easy is it to write something performant -> Good abstractions but questionable performance
  • Standard Library -> Do we have to rewrite parts? -> File reading
  • Ideas -> Pivoting to new ideas -> Not that hard
  • How well can we measure performance -> Control and Iteration -> with JMH/JVM tooling
  • Ecosystem -> Do people care? -> Yes, but there is a lot of fragmentation

PRESENTATION

08 / 13

Rust

  • At the hardware level? -> Optimizations -> via LLVM
  • Assembly -> Instructions -> yes, multiple methods
  • LLVM/Virtual Machine? -> Intermediate Representation/Target -> One of the better languages
  • Logic -> How easy is it to write something performant -> default
  • Standard Library -> Do we have to rewrite parts? -> yes, to get the last bit of performance
  • Ideas -> Pivoting to new ideas -> always possbile but listen to clippy
  • How well can we measure performance? -> Control and Iteration -> cargo bench and integrations
  • Ecosystem -> Do people care? -> yes.. too much

PRESENTATION

09 / 13

Feasibility

How hard is it to write fast enough Rust code?

  • Advent of Code Anecdote (Dumb algorithm worked)
  • Rewrite Anecdote (Kotlin four times slower)
  • Clippy will help
  • Use references where possible
  • Stay clear from tricks to achieve perfect code
  • Use compile time flags before runtime injection
  • Put performance testing also into the deployed binary
  • Fearless mutation (mut)
  • Fearless parallelism (Rayon)

PRESENTATION

10 / 13

Rule of Thumb

  • Faster than the network latency noise -> Good
  • Slower than the network latency noise -> Bad

PRESENTATION

11 / 13

PRESENTATION

12 / 13

PRESENTATION

13 / 13

LICENSE

Non-Commercial License This license covers everything in this repository that its author created, not just the software: source code, documentation, papers and notes, slides and presentations, data, images, and other original material (together, the "Works"). Third-party content is not covered — see clause 2. 1. **Non-Commercial Use Only**: The Works may only be used for non-commercial purposes. Any commercial use, including but not limited to sale, licensing, or use in commercial products or services, is strictly prohibited. 2. **Third-Party Content**: Vendored dependencies, submodules, datasets, fonts, and any other third-party material included in the repository remain under their own licenses and terms. This license grants no rights to that content, and using it is subject to its own license regardless of what this one allows. 3. **No AI/ML Training**: The Works may not be used for training large language models (LLMs), machine learning models, or for any other form of AI/ML training or fine-tuning, whether commercial or non-commercial. 4. **No Redistribution for Training**: You may not distribute, share, or make the Works available to others for the purpose of AI/ML training. 5. **Attribution**: When you share or adapt the Works in a way this license permits, keep a notice of this license and credit the author as the copyright holder. 6. **Permitted Uses**: You may use and adapt the Works for personal, educational, research (non-AI/ML), and other non-commercial purposes, provided you comply with all other restrictions. 7. **No Warranty**: The Works are provided "AS IS" without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. 8. **Termination**: Violation of any of these terms will result in immediate termination of your rights to use the Works.

PRINT

Choose “Save as PDF” in the dialog to download the deck.