r/MachineLearning • • Sep 07 '26

Project Rustuna: A High-Performance Rust Implementation of Optuna [P]

Post image

Hi everyone! We just released Rustuna (GitHub: https://github.com/optuna/rustuna/ ), a high-speed, memory-efficient implementation of Optuna built in Rust.

  • Optuna-Compatible Design: Keeps the familiar API and concept of Optuna.
  • Zero Python Dependencies: Mitigating the risk of supply chain attacks.
  • Lower Memory Footprint: Optimized memory management natively in Rust.

For details, please check out the following blog post.

https://medium.com/optuna/announcing-rustuna-cc82a6815bf7

102 Upvotes

22 comments sorted by

View all comments

Show parent comment

4

u/c-bata Sep 07 '26 edited Sep 07 '26

Personally, rather than just the evaluation time of a single trial, I'd say the threshold comes down to the total number of evaluations , specifically when you are running 10,000+ trials.

In Optuna's default sampler (TPE), the time required for parameter sampling grows linearly (O(n logn)) with the number of trials n. For 1,000 trials, it takes about 10 seconds. However, running 10,000 trials in Python Optuna can take several hours, and going even higher can easily take days.

With Rustuna, sampling 10,000 parameters takes only 1 minute on a single thread. It also scales extremely well with multi-threading, using just 2 threads drops that time to just over 30 seconds. Plus, its low memory footprint makes it much easier to leverage multi-processing. So, if your workload requires thousands of trials, simply switching to Rustuna can save you hours to days of overhead without changing your algorithm setup.

1

u/RLJ05 Sep 08 '26

I’m usually doing around 50,000 trials at the moment