# BigInt is really really slow when run on linux, Or just Boehm GC issue?

**URL:** <https://forum.crystal-lang.org/t/bigint-is-really-really-slow-when-run-on-linux-or-just-boehm-gc-issue/4956>\
**Category:** Help & Support\
**Created:** [September 21, 2022, 1:11pm UTC](https://forum.crystal-lang.org/t/bigint-is-really-really-slow-when-run-on-linux-or-just-boehm-gc-issue/4956 "2022-09-21T13:11:41Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![naqvis](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/naqvis/32/906_2.png) [@naqvis](https://forum.crystal-lang.org/u/naqvis)\
**Post date:** [September 22, 2022, 11:50am UTC](https://forum.crystal-lang.org/t/bigint-is-really-really-slow-when-run-on-linux-or-just-boehm-gc-issue/4956/23 "2022-09-22T11:50:48Z")

</div>

I guess it would be this change

```auto
diff --git a/src/big/lib_gmp.cr b/src/big/lib_gmp.cr
index 446f3ea5a..1791f00c4 100644
--- a/src/big/lib_gmp.cr
+++ b/src/big/lib_gmp.cr
@@ -240,7 +240,7 @@ lib LibGMP
 end

 LibGMP.set_memory_functions(
- ->(size) { GC.malloc(size) },
+ ->(size) { GC.malloc_atomic(size) },
   ->(ptr, old_size, new_size) { GC.realloc(ptr, new_size) },
   ->(ptr, size) { GC.free(ptr) }
 )

```

---

_[View the full topic](https://forum.crystal-lang.org/t/bigint-is-really-really-slow-when-run-on-linux-or-just-boehm-gc-issue/4956)._
