# Performance

**URL:** https://discourse.julialang.org/c/usage/perf/37.md?page=2

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 3

---

## [Contradictory nested function performance and allocation](https://discourse.julialang.org/t/contradictory-nested-function-performance-and-allocation/136548)

<div class="topic-metadata">

**Author:** [@lilachint](https://discourse.julialang.org/u/lilachint)\
**Replies:** 2\
**Last updated:** [April 4, 2026, 8:38am UTC](https://discourse.julialang.org/t/contradictory-nested-function-performance-and-allocation/136548 "2026-04-04T08:38:44Z")

</div>

Recently when working on sorting data with Hilbert curves, I noticed something very peculiar when benchmarking. function hilbert\_sort(m::AbstractMatrix{\<:Integer}, b::Integer; rev::Bool = false) return m\[:, hilbert\_…

---

## [Multithreading performance in different Julia versions](https://discourse.julialang.org/t/multithreading-performance-in-different-julia-versions/136538)

<div class="topic-metadata">

**Author:** [@songjhaha](https://discourse.julialang.org/u/songjhaha)\
**Replies:** 0\
**Last updated:** [April 3, 2026, 8:05am UTC](https://discourse.julialang.org/t/multithreading-performance-in-different-julia-versions/136538 "2026-04-03T08:05:40Z")

</div>

I found an example performances quite diff in Julia 1.10 vs other version in MWE: # GC.enable\_logging(true) function myinterp1(X, V, Xq, method) complex.( \_myinterp1(X, real(V), Xq, method), \_myinterp1(X, imag(…

---

## [Reactant.jl + Enzyme: ~10 min compilation overhead triggered by hidden-to-hidden Dense layers](https://discourse.julialang.org/t/reactant-jl-enzyme-10-min-compilation-overhead-triggered-by-hidden-to-hidden-dense-layers/136374)

<div class="topic-metadata">

**Author:** [@Yuan-Ru-Lin](https://discourse.julialang.org/u/Yuan-Ru-Lin)\
**Replies:** 1\
**Last updated:** [March 27, 2026, 11:22am UTC](https://discourse.julialang.org/t/reactant-jl-enzyme-10-min-compilation-overhead-triggered-by-hidden-to-hidden-dense-layers/136374 "2026-03-27T11:22:11Z")

</div>

I’ve been investigating compilation times with Reactant.jl + Lux + AutoEnzyme() on an NVIDIA GPU and found a reproducible jump in TTFT (Time-To-First-Training) when a model includes hidden-to-hidden Dense layers. Minima…

---

## [Functions with identical native code but different benchmarks](https://discourse.julialang.org/t/functions-with-identical-native-code-but-different-benchmarks/136336)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 14\
**Last updated:** [March 27, 2026, 4:27am UTC](https://discourse.julialang.org/t/functions-with-identical-native-code-but-different-benchmarks/136336 "2026-03-27T04:27:13Z")

</div>

I’m currently rewriting some low-level code in one of my packages. I’m seeing that the new function runs 2-3 times slower than the old one (~12ns instead of ~5ns) although @code\_native shows exactly the same code. The sl…

---

## [What is the fastest way of realizing transpose of a CSR (or CSC) matrix?](https://discourse.julialang.org/t/what-is-the-fastest-way-of-realizing-transpose-of-a-csr-or-csc-matrix/136241)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 33\
**Last updated:** [March 19, 2026, 7:37pm UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-of-realizing-transpose-of-a-csr-or-csc-matrix/136241 "2026-03-19T19:37:49Z")

</div>

What is the fastest way of realizing sparse matrix transpose? I don’t mean a lazy transpose, I mean realization such that typeof(CSC') === typeof(CSC) (and analogously for CSR). There seems to be the algorithm of Gustav…

---

## [Command line performance: pkg app, precompilation and juliac](https://discourse.julialang.org/t/command-line-performance-pkg-app-precompilation-and-juliac/136233)

<div class="topic-metadata">

**Author:** [@FerreolS](https://discourse.julialang.org/u/FerreolS)\
**Replies:** 4\
**Last updated:** [March 18, 2026, 7:30am UTC](https://discourse.julialang.org/t/command-line-performance-pkg-app-precompilation-and-juliac/136233 "2026-03-18T07:30:14Z")

</div>

Hi, I just want to share my experience building a command-line tool in Julia. A few years ago, I developed a small (unregistered) package, FITSexplore, to manipulate FITS files and their headers/keywords. Recently, I …

---

## [Is Claude right on this (a cache size growing analysis)?](https://discourse.julialang.org/t/is-claude-right-on-this-a-cache-size-growing-analysis/135688)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 16\
**Last updated:** [March 13, 2026, 1:19pm UTC](https://discourse.julialang.org/t/is-claude-right-on-this-a-cache-size-growing-analysis/135688 "2026-03-13T13:19:03Z")

</div>

I have been asking Clade to investigate why cache sizes grow so much with with not so much precompiled code. I’m showing here the results of a smaller example (but I have one where “acusations” are heavier when trying to…

---

## [Numpy vs Julia matrix multiplication](https://discourse.julialang.org/t/numpy-vs-julia-matrix-multiplication/135992)

<div class="topic-metadata">

**Author:** [@bernardofpc](https://discourse.julialang.org/u/bernardofpc)\
**Replies:** 7\
**Last updated:** [March 13, 2026, 7:42am UTC](https://discourse.julialang.org/t/numpy-vs-julia-matrix-multiplication/135992 "2026-03-13T07:42:30Z")

</div>

I have performed two very simple tests in numpy and julia, and have obtained what I believe are significant differences in performance. This is on Windows 11, CPU: 28 × Intel(R) Core™ i7-14700. Numpy (python 3.12.7): I…

---

## [Parallelization in Julia vs C++](https://discourse.julialang.org/t/parallelization-in-julia-vs-c/136083)

<div class="topic-metadata">

**Author:** [@Rkiefe](https://discourse.julialang.org/u/Rkiefe)\
**Replies:** 21\
**Last updated:** [March 11, 2026, 1:04pm UTC](https://discourse.julialang.org/t/parallelization-in-julia-vs-c/136083 "2026-03-11T13:04:01Z")

</div>

Do you tend to have problems parallelizing thousands of fast computations over a large matrix? I’m going to show a Julia and then a C++ version of the code snippet. I get a lot more performance benefits from parallelizat…

---

## [Julia takes up a lot of space on my disk - what can be cleaned?](https://discourse.julialang.org/t/julia-takes-up-a-lot-of-space-on-my-disk-what-can-be-cleaned/136102)

<div class="topic-metadata">

**Author:** [@amca01](https://discourse.julialang.org/u/amca01)\
**Replies:** 6\
**Last updated:** [March 11, 2026, 4:05am UTC](https://discourse.julialang.org/t/julia-takes-up-a-lot-of-space-on-my-disk-what-can-be-cleaned/136102 "2026-03-11T04:05:11Z")

</div>

Specifically, in the ~/.julia directory of my home directory, I have these vast collections (as given by ncdu): 4.9 GiB \[################\] /artifacts …

---

## [Why do \`@allocated\` and \`Profile.Allocs.@profile\` give different results?](https://discourse.julialang.org/t/why-do-allocated-and-profile-allocs-profile-give-different-results/134956)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 1\
**Last updated:** [March 10, 2026, 2:52pm UTC](https://discourse.julialang.org/t/why-do-allocated-and-profile-allocs-profile-give-different-results/134956 "2026-03-10T14:52:52Z")

</div>

The number of allocations reported by Profile.Allocs.@profile agrees with @allocations, but the total number of bytes allocated differs from @allocated for some reason: using Profile.Allocs f(n) = sum(2\*collect(1:n)) …

---

## [Improving the fastest pure-Julia cryptographic hash!](https://discourse.julialang.org/t/improving-the-fastest-pure-julia-cryptographic-hash/104386)

<div class="topic-metadata">

**Author:** [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Replies:** 4\
**Last updated:** [March 8, 2026, 11:08pm UTC](https://discourse.julialang.org/t/improving-the-fastest-pure-julia-cryptographic-hash/104386 "2026-03-08T23:08:59Z")

</div>

Hi All! For another project of mine, I wanted a good fast hash that wasn’t trivial to mock. After an excessive amount of investigation, I’ve settled on KangarooTwelve. To quote the project readme, I think it strikes a r…

---

## [Sysimage creation process gets OOM killed (out-of-memory)](https://discourse.julialang.org/t/sysimage-creation-process-gets-oom-killed-out-of-memory/136079)

<div class="topic-metadata">

**Author:** [@Abhro](https://discourse.julialang.org/u/Abhro)\
**Replies:** 3\
**Last updated:** [March 7, 2026, 3:15pm UTC](https://discourse.julialang.org/t/sysimage-creation-process-gets-oom-killed-out-of-memory/136079 "2026-03-07T15:15:40Z")

</div>

When I try to create a sysimage with Makie in it (or maybe any other heavy package, Makie’s the only one I’ve noticed), the create\_sysimage() call gets to the “Compiling incremental sysimage” stage, then crashes, also ex…

---

## [Why isn't julia broadcasting through my function](https://discourse.julialang.org/t/why-isnt-julia-broadcasting-through-my-function/135959)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 3\
**Last updated:** [March 2, 2026, 4:45pm UTC](https://discourse.julialang.org/t/why-isnt-julia-broadcasting-through-my-function/135959 "2026-03-02T16:45:44Z")

</div>

Why isn’t julia broadcasting through the function f2 below: f1(x) = "scalar" Base.broadcasted( ::typeof(f1), x ) = "broadcasted" x = randn(10); f1.(x) f2(x) = f1(x) f2.(x) I would like f2.(x) to return "broadcasted".…

---

## [Combining reshape and view sometimes allocates](https://discourse.julialang.org/t/combining-reshape-and-view-sometimes-allocates/135725)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 2\
**Last updated:** [February 20, 2026, 2:31am UTC](https://discourse.julialang.org/t/combining-reshape-and-view-sometimes-allocates/135725 "2026-02-20T02:31:05Z")

</div>

I have some complicated code that uses a combination of reshape() and view(), and in my complicated code both reshape() and view() allocates. Trying to reduce my code to an MRE, I came up with this: function profile\_all…

---

## [Benchmarking and Pkg.test()](https://discourse.julialang.org/t/benchmarking-and-pkg-test/27719)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 5\
**Last updated:** [February 19, 2026, 2:18pm UTC](https://discourse.julialang.org/t/benchmarking-and-pkg-test/27719 "2026-02-19T14:18:28Z")

</div>

This post is an offspring of the following discussion, where I reported inconsistencies in the benchmarked performances of Base.sum between machines. To summarize the issue (which is illustrated a bit more clearly bel…

---

## [Simple simulation](https://discourse.julialang.org/t/simple-simulation/135701)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 8\
**Last updated:** [February 17, 2026, 11:00am UTC](https://discourse.julialang.org/t/simple-simulation/135701 "2026-02-17T11:00:07Z")

</div>

Is there an easy way to speed this up? sims = 10\_000 T = 1 σ = .1 Δ = .000001 σrΔ = σ√Δ steps = (Int64 ∘ round)(T/Δ) L = .9 H = 1.1 x = ones( sims ) alive = trues( sims ) …

---

## [ODBC querying Snowflake is super slow](https://discourse.julialang.org/t/odbc-querying-snowflake-is-super-slow/131718)

<div class="topic-metadata">

**Author:** [@Snowy](https://discourse.julialang.org/u/Snowy)\
**Replies:** 4\
**Last updated:** [February 11, 2026, 3:11pm UTC](https://discourse.julialang.org/t/odbc-querying-snowflake-is-super-slow/131718 "2026-02-11T15:11:11Z")

</div>

Hi all, I’m trying to use ODBC.jl to query our enterprise’s Snowflake server. Fortunately, it works. Unfortunately, it’s extremely slow. E.g. pulling 1000 rows via ODBC takes 1.5 minutes. Pulling the same 1000 rows in t…

---

## [Reactant: how to use it, limititations and opportunities?](https://discourse.julialang.org/t/reactant-how-to-use-it-limititations-and-opportunities/135559)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 1\
**Last updated:** [February 11, 2026, 12:49am UTC](https://discourse.julialang.org/t/reactant-how-to-use-it-limititations-and-opportunities/135559 "2026-02-11T00:49:04Z")

</div>

After reading a few posts (and some suggestion from @wmshen0323 to try Enzyme), Reactant got my attention. My understanding is that, if I manage to compile my code with Reactant, I get for free to run my code on GPUs and…

---

## [Extract unique types between two Tuples at compile time](https://discourse.julialang.org/t/extract-unique-types-between-two-tuples-at-compile-time/135476)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 10\
**Last updated:** [February 9, 2026, 7:20pm UTC](https://discourse.julialang.org/t/extract-unique-types-between-two-tuples-at-compile-time/135476 "2026-02-09T19:20:56Z")

</div>

Hello, I have two Tuples x and y containing objects of different types. I now want to create at compile time a list containing only the unique types. I have tried this function test2(x::T1, y::T2) where {T1 \<: Tuple, T…

---

## [How to avoid runtime-dispatch in loop](https://discourse.julialang.org/t/how-to-avoid-runtime-dispatch-in-loop/135517)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 7\
**Last updated:** [February 9, 2026, 6:22pm UTC](https://discourse.julialang.org/t/how-to-avoid-runtime-dispatch-in-loop/135517 "2026-02-09T18:22:59Z")

</div>

If i have a vector of different objects it is inherently an abstract type. How can I still avoid runtime-dispatch when looping over it? abstract type AbstractFoo end mutable struct Foo1 \<: AbstractFoo k::Float64 end m…

---

## [Does @propagate\_inbounds affect one method, or all methods (-\> the function)?](https://discourse.julialang.org/t/does-propagate-inbounds-affect-one-method-or-all-methods-the-function/135461)

<div class="topic-metadata">

**Author:** [@marteaua](https://discourse.julialang.org/u/marteaua)\
**Replies:** 3\
**Last updated:** [February 6, 2026, 11:24am UTC](https://discourse.julialang.org/t/does-propagate-inbounds-affect-one-method-or-all-methods-the-function/135461 "2026-02-06T11:24:45Z")

</div>

The Base.@propagate\_inbounds documentation says the macro affects the annotated “function”. Does it mean that it affects all the method defined to a specific function ? Or just the annotated method? I ask because I wan…

---

## [Caching in Integrals.jl](https://discourse.julialang.org/t/caching-in-integrals-jl/135443)

<div class="topic-metadata">

**Author:** [@omerc](https://discourse.julialang.org/u/omerc)\
**Replies:** 4\
**Last updated:** [February 5, 2026, 2:25am UTC](https://discourse.julialang.org/t/caching-in-integrals-jl/135443 "2026-02-05T02:25:25Z")

</div>

Recently, I tried to numerically integrate a function for multiple parameters. The integral is four dimensional, so I use CubatureJLh() (but I don’t mind using other methods - the documentation doesn’t elaborate a lot on…

---

## [Is scalar getindex supposed to be allocating](https://discourse.julialang.org/t/is-scalar-getindex-supposed-to-be-allocating/135427)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 2\
**Last updated:** [February 3, 2026, 2:30pm UTC](https://discourse.julialang.org/t/is-scalar-getindex-supposed-to-be-allocating/135427 "2026-02-03T14:30:30Z")

</div>

I am a bit stumped by the behavior I have bumped into. I thought that only slicing allocates and scalar indexing should not. But try this thing: a = collect(0.0:1.0:10.0) a\[2\] @allocated a\[2\] For me, it somehow alloca…

---

## [Improve performance of this index creation and accessing code](https://discourse.julialang.org/t/improve-performance-of-this-index-creation-and-accessing-code/134235)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 65\
**Last updated:** [January 30, 2026, 3:47pm UTC](https://discourse.julialang.org/t/improve-performance-of-this-index-creation-and-accessing-code/134235 "2026-01-30T15:47:32Z")

</div>

How to improve the performance of clp(j) function given below. Please suggest faster version of this code. I am converting spherical coordinates to Cartesian and placing color values to exact location in data. Otherwise…

---

## [Loading an image in place](https://discourse.julialang.org/t/loading-an-image-in-place/135276)

<div class="topic-metadata">

**Author:** [@mj2984](https://discourse.julialang.org/u/mj2984)\
**Replies:** 4\
**Last updated:** [January 26, 2026, 10:50pm UTC](https://discourse.julialang.org/t/loading-an-image-in-place/135276 "2026-01-26T22:50:03Z")

</div>

Is there any method available in general libraries that can load images to a pre allocated array (to avoid allocations during runtime), assuming the user knows the image size (or pre allocates a larger array and fills a …

---

## [What's the fastest way to fill an array with random bits without using private Random.jl internals?](https://discourse.julialang.org/t/whats-the-fastest-way-to-fill-an-array-with-random-bits-without-using-private-random-jl-internals/135089)

<div class="topic-metadata">

**Author:** [@npbarnes](https://discourse.julialang.org/u/npbarnes)\
**Replies:** 16\
**Last updated:** [January 21, 2026, 6:59pm UTC](https://discourse.julialang.org/t/whats-the-fastest-way-to-fill-an-array-with-random-bits-without-using-private-random-jl-internals/135089 "2026-01-21T18:59:25Z")

</div>

Suppose I have an array of type e.g. Array{Float64} and I want to fill it with random bits as fast as possible. Note that that’s different from filling it with random floats between 0 and 1. A straight forward way to do …

---

## [How to get the device name and the number of Compute units when using oneAPI.jl or AMDGPU.jl?](https://discourse.julialang.org/t/how-to-get-the-device-name-and-the-number-of-compute-units-when-using-oneapi-jl-or-amdgpu-jl/128361)

<div class="topic-metadata">

**Author:** [@bpsomu](https://discourse.julialang.org/u/bpsomu)\
**Replies:** 1\
**Last updated:** [January 18, 2026, 5:31pm UTC](https://discourse.julialang.org/t/how-to-get-the-device-name-and-the-number-of-compute-units-when-using-oneapi-jl-or-amdgpu-jl/128361 "2026-01-18T17:31:01Z")

</div>

I am working on making a GPU vendor agnostic code with KerneAbstractions.jl. I am getting the device name with device = CUDA.device() and getting the number of Streaming Multiprocessors with sm\_count = CUDA.attribute(…

---

## [Is the allocation from @time the total at the end, or during a calculation?](https://discourse.julialang.org/t/is-the-allocation-from-time-the-total-at-the-end-or-during-a-calculation/135111)

<div class="topic-metadata">

**Author:** [@dankelley](https://discourse.julialang.org/u/dankelley)\
**Replies:** 4\
**Last updated:** [January 17, 2026, 7:02pm UTC](https://discourse.julialang.org/t/is-the-allocation-from-time-the-total-at-the-end-or-during-a-calculation/135111 "2026-01-17T19:02:52Z")

</div>

As a newcomer to Julia, I am writing some code to work with oceanographic datasets that are fairly large. A test file is 138MiB in size but the instrument that creates the data can emit files up to about 4GiB in size. …

---

## [In-place mul! much slower than \* for real-complex matrix multiplication](https://discourse.julialang.org/t/in-place-mul-much-slower-than-for-real-complex-matrix-multiplication/134938)

<div class="topic-metadata">

**Author:** [@chrisbrahms](https://discourse.julialang.org/u/chrisbrahms)\
**Replies:** 9\
**Last updated:** [January 8, 2026, 6:23am UTC](https://discourse.julialang.org/t/in-place-mul-much-slower-than-for-real-complex-matrix-multiplication/134938 "2026-01-08T06:23:12Z")

</div>

In some use cases of Luna.jl, the runtime is dominated by large matrix-matrix multiplications inside Hankel.jl. I see a dramatic performance drop when using complex-valued matrices, which I’ve traced to the mul! operatio…

[Previous page](https://discourse.julialang.org/c/usage/perf/37.md?page=1)

[Next page](https://discourse.julialang.org/c/usage/perf/37.md?page=3)
