# Performance detoriation with the increase of array size

**URL:** <https://discourse.julialang.org/t/performance-detoriation-with-the-increase-of-array-size/122364>\
**Category:** General Usage\
**Created:** [November 7, 2024, 2:37am UTC](https://discourse.julialang.org/t/performance-detoriation-with-the-increase-of-array-size/122364 "2024-11-07T02:37:50Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [November 22, 2024, 10:48am UTC](https://discourse.julialang.org/t/performance-detoriation-with-the-increase-of-array-size/122364/14 "2024-11-22T10:48:38Z")

</div>

> [@sgaure](#):
>
> There are various ways to use huge pages

The easiest way is via

```julia
$cat /sys/kernel/mm/transparent_hugepage/enabled 
[always] madvise never
$ cat /sys/kernel/mm/transparent_hugepage/defrag
always defer [defer+madvise] madvise never

```

Julia is afaiu not very good at using madvise appropriately, and many systems default to `madvise` as their THP settings. The above settings respect explicit madvise, but do a pretty appropriate thing in absence of explicit user choices (which is: Use hugepages where possible, and always try to compact in a background thread).

---

_[View the full topic](https://discourse.julialang.org/t/performance-detoriation-with-the-increase-of-array-size/122364)._
