# Build with --release performance is slow than the 2017 crystal version?

**URL:** <https://forum.crystal-lang.org/t/build-with-release-performance-is-slow-than-the-2017-crystal-version/4677>\
**Category:** Help & Support\
**Created:** [June 11, 2022, 4:01pm UTC](https://forum.crystal-lang.org/t/build-with-release-performance-is-slow-than-the-2017-crystal-version/4677 "2022-06-11T16:01:30Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![yxhuvud](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/yxhuvud/32/27_2.png) [@yxhuvud](https://forum.crystal-lang.org/u/yxhuvud)\
**Post date:** [June 11, 2022, 8:35pm UTC](https://forum.crystal-lang.org/t/build-with-release-performance-is-slow-than-the-2017-crystal-version/4677/5 "2022-06-11T20:35:42Z")

</div>

That said, some minor changes bring down the time to a fraction of the original:

```auto
size = 10 ** 5
a = (1..size).map { {rand(1000), rand(1000)} }

def dist(u, v)
  (u[0] - v[0]).abs + (u[1] - v[1]).abs
end

a.each_with_index { |u, i|
  print "\r#{i}" if i % 100 == 0
  ((i + 1)..(a.size - 1)).each { |v|
    dist(u, a[v]) < 3
  }
}

```

takes

```auto
real	0m22,396s
user	0m22,395s
sys	0m0,001s

```

on my machine where the original took 1.35 minutes

---

_[View the full topic](https://forum.crystal-lang.org/t/build-with-release-performance-is-slow-than-the-2017-crystal-version/4677)._
