# Binary executable slower on the first run

**URL:** <https://forum.crystal-lang.org/t/binary-executable-slower-on-the-first-run/4759>\
**Category:** Help & Support\
**Created:** [July 4, 2022, 10:40pm UTC](https://forum.crystal-lang.org/t/binary-executable-slower-on-the-first-run/4759 "2022-07-04T22:40:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lln13](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@lln13](https://forum.crystal-lang.org/u/lln13)\
**Post date:** [July 4, 2022, 10:40pm UTC](https://forum.crystal-lang.org/t/binary-executable-slower-on-the-first-run/4759/1 "2022-07-04T22:40:38Z")

</div>

Hi everyone,

I’ve compiled an executable using `crystal build script.cr --release` and noticing that it is slower the first time I run it. After the first run I get the performance I’m looking for. Is this behavior expected?

First run

```auto
real	0m0.661s
user	0m0.159s
sys	0m0.090s

```

Second run

```auto
real	0m0.083s
user	0m0.059s
sys	0m0.027s

```

I’ve done this rough testing and from the second run, the average time it takes to run is ~0m0.081s. Is this expected?

---

<div class="post-metadata">

**Author:** ![asterite](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/asterite/32/60_2.png) [@asterite](https://forum.crystal-lang.org/u/asterite)\
**Post date:** [July 4, 2022, 10:52pm UTC](https://forum.crystal-lang.org/t/binary-executable-slower-on-the-first-run/4759/2 "2022-07-04T22:52:41Z")

</div>

Is this on a Mac? I think in recent versions they changed something and do some checks when an executable runs the first time. You could check if that’s also true with other languages, like Go, Rust or Nim

---

<div class="post-metadata">

**Author:** ![lln13](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@lln13](https://forum.crystal-lang.org/u/lln13)\
**Post date:** [July 4, 2022, 10:55pm UTC](https://forum.crystal-lang.org/t/binary-executable-slower-on-the-first-run/4759/3 "2022-07-04T22:55:12Z")

</div>

Yes, it’s on a Mac. Do you know what checks are being performed and if one can choose to skip them?

---

<div class="post-metadata">

**Author:** ![asterite](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/asterite/32/60_2.png) [@asterite](https://forum.crystal-lang.org/u/asterite)\
**Post date:** [July 4, 2022, 10:55pm UTC](https://forum.crystal-lang.org/t/binary-executable-slower-on-the-first-run/4759/4 "2022-07-04T22:55:13Z")

</div>

Maybe this? [Catalina is checking notarization of unsigned executables](https://lapcatsoftware.com/articles/catalina-executables.html)

---

<div class="post-metadata">

**Author:** ![lln13](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@lln13](https://forum.crystal-lang.org/u/lln13)\
**Post date:** [July 4, 2022, 11:11pm UTC](https://forum.crystal-lang.org/t/binary-executable-slower-on-the-first-run/4759/5 "2022-07-04T23:11:20Z")

</div>

Thanks!
