Repository: TeXitoi/benchmarksgame-rs (language: rust)

Issue:
Mandelbrot performance regression
So weirdly it looks like when ioguy evaluated the mandelbrot solution from #40, preformance degraded by half. I can't reproduce this locally, for me it's always faster, but maybe it's worth reverting the code? https://alioth.debian.org/tracker/?func=detail&atid=413122&aid=315634&group_id=100815


Discussion / hints:
Maybe that's LTO related?
Ah yes, locally LTO makes a big difference for this benchmark!
Maybe we can ask Isaac to reuse LTO, the problems may be fixed now. That make me confident for the other benchmarks :smile: 

Fix patch:
diff --git a/Makefile b/Makefile
index 28ea8dc..601fdd8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 SOURCES = $(wildcard src/*.rs)
 RUSTC ?= rustc
-RUSTC_FLAGS ?= -C opt-level=3 -C target-cpu=core2 -C lto
+RUSTC_FLAGS ?= -C opt-level=3 -C target-cpu=core2
 RUSTC_FLAGS += -L ./lib
 REGEX ?= regex-0.2.1
 ARENA ?= typed-arena-1.1.0
diff --git a/src/mandelbrot.rs b/src/mandelbrot.rs
index ec396c0..a00ec11 100644
--- a/src/mandelbrot.rs
+++ b/src/mandelbrot.rs
@@ -90,6 +90,7 @@ impl Mandelbrot8 {
         self.to_byte()
     }
 
+    #[inline]
     fn advance(&mut self, iterations: usize) {
         for _ in 0..iterations {
             self.zi = (self.zr + self.zr) * self.zi + self.ci;


Test patch: