# Performance

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

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

**Page:** 8

---

## [Why is LoopVectorization deprecated?](https://discourse.julialang.org/t/why-is-loopvectorization-deprecated/109547)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 141\
**Last updated:** [July 13, 2025, 3:58pm UTC](https://discourse.julialang.org/t/why-is-loopvectorization-deprecated/109547 "2025-07-13T15:58:02Z")

</div>

In the README file of JuliaSIMD/LoopVectorization.jl: Macro(s) for vectorizing loops. (github.com) it is clearly stated that the package is deprecated for Julia 1.11 and newer versions, without any explanation. Anyone kn…

---

## [Type stability in hierarchichal function calls](https://discourse.julialang.org/t/type-stability-in-hierarchichal-function-calls/130603)

<div class="topic-metadata">

**Author:** [@thomasc791](https://discourse.julialang.org/u/thomasc791)\
**Replies:** 2\
**Last updated:** [July 10, 2025, 2:39pm UTC](https://discourse.julialang.org/t/type-stability-in-hierarchichal-function-calls/130603 "2025-07-10T14:39:51Z")

</div>

Hi all, I have a question on how type stability traverses into layers of function calls. Meaning, if I have a function assembly that is not completely type stable, because it contains a Vector{Types}. In assembly I call…

---

## [Performance discrepancy in solving sparse SPD\\dense rhs between X86 and Apple M](https://discourse.julialang.org/t/performance-discrepancy-in-solving-sparse-spd-dense-rhs-between-x86-and-apple-m/130476)

<div class="topic-metadata">

**Author:** [@pitsianis](https://discourse.julialang.org/u/pitsianis)\
**Replies:** 2\
**Last updated:** [July 4, 2025, 8:06pm UTC](https://discourse.julialang.org/t/performance-discrepancy-in-solving-sparse-spd-dense-rhs-between-x86-and-apple-m/130476 "2025-07-04T20:06:43Z")

</div>

Why do I observe a 9x difference in elapsed times when I run the following on my macbook laptop using Random, SparseArrays, LinearAlgebra Random.seed!(0); A = sprand(10000,10000,5/10000) + I; A = max.(A,A'); b = rand(…

---

## [Repeated allocations for fft in pseudospectral code](https://discourse.julialang.org/t/repeated-allocations-for-fft-in-pseudospectral-code/130472)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 1\
**Last updated:** [July 4, 2025, 4:37pm UTC](https://discourse.julialang.org/t/repeated-allocations-for-fft-in-pseudospectral-code/130472 "2025-07-04T16:37:44Z")

</div>

I’m trying to tune a pseudospectral PDE code which has calls to fft and ifft at every iteration. I was wondering if there was some way to reduce the repeated memory allocations (assuming this improves performance). By …

---

## [In-place SciMLOperators](https://discourse.julialang.org/t/in-place-scimloperators/130457)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 0\
**Last updated:** [July 3, 2025, 5:19pm UTC](https://discourse.julialang.org/t/in-place-scimloperators/130457 "2025-07-03T17:19:02Z")

</div>

Hello :grinning:, Can anyone tell me more about SciMLOperators.jl’s in-place operations? using SciMLOperators using BenchmarkTools function Afunc!(w,v,u,p,t) w\[1\] = -2v\[1\] + v\[2\] for i in 2:4 w\[i\] = v\[…

---

## [Ldiv for Cholesky is slower than two substitutions](https://discourse.julialang.org/t/ldiv-for-cholesky-is-slower-than-two-substitutions/130092)

<div class="topic-metadata">

**Author:** [@stepanzh](https://discourse.julialang.org/u/stepanzh)\
**Replies:** 13\
**Last updated:** [July 2, 2025, 9:09pm UTC](https://discourse.julialang.org/t/ldiv-for-cholesky-is-slower-than-two-substitutions/130092 "2025-07-02T21:09:15Z")

</div>

I’ve faced that ldiv for Cholesky is unexpectedly slower than two substitutions. Here is a test problem with a random 1000-by-1000 Matrix{Float64}. julia\> using BenchmarkTools, LinearAlgebra julia\> n = 1000; A = rand(…

---

## [Donations link for sciml is broken](https://discourse.julialang.org/t/donations-link-for-sciml-is-broken/130389)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 6\
**Last updated:** [July 1, 2025, 8:17pm UTC](https://discourse.julialang.org/t/donations-link-for-sciml-is-broken/130389 "2025-07-01T20:17:01Z")

</div>

Wanted to contribute to: SciML Small Grants Program Current Project List But, the Donate link (see below) appears to be broken. Donate Is it adequately funded for now or working with the 1 month (“prevent sniping”) b…

---

## [Getting around the strict aliasing rule in Julia](https://discourse.julialang.org/t/getting-around-the-strict-aliasing-rule-in-julia/130140)

<div class="topic-metadata">

**Author:** [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Replies:** 1\
**Last updated:** [June 30, 2025, 6:09pm UTC](https://discourse.julialang.org/t/getting-around-the-strict-aliasing-rule-in-julia/130140 "2025-06-30T18:09:19Z")

</div>

I am trying to better understand Julia’s equivalent of the strict aliasing rule from C. As background I would like to implement various decoding algorithms in Julia. Looking at the LZ4 C code, they are careful to use me…

---

## [Unexpected poor FOR loops performance](https://discourse.julialang.org/t/unexpected-poor-for-loops-performance/130276)

<div class="topic-metadata">

**Author:** [@andreasvarga](https://discourse.julialang.org/u/andreasvarga)\
**Replies:** 8\
**Last updated:** [June 28, 2025, 12:45pm UTC](https://discourse.julialang.org/t/unexpected-poor-for-loops-performance/130276 "2025-06-28T12:45:27Z")

</div>

It is generally accepted that Julia is for loops friendly, so generally no special care is required to vectorize code, because Julia will do a good job anyway. Let A and X be n x n matrices, with X symmetric. The followi…

---

## [Faster \`div\`, \`rem\` and \`mod\` for small integers?](https://discourse.julialang.org/t/faster-div-rem-and-mod-for-small-integers/130264)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 4\
**Last updated:** [June 27, 2025, 1:55am UTC](https://discourse.julialang.org/t/faster-div-rem-and-mod-for-small-integers/130264 "2025-06-27T01:55:17Z")

</div>

I’ve played around with div, rem and mod for signed bit integers. I first noticed that these functions are faster for Int32 than for Int64 on amd64 processors. (This becomes clear if you look at the processor instruction…

---

## [Questions about Juliac](https://discourse.julialang.org/t/questions-about-juliac/130213)

<div class="topic-metadata">

**Author:** [@Max\_Pan](https://discourse.julialang.org/u/Max_Pan)\
**Replies:** 1\
**Last updated:** [June 26, 2025, 1:41am UTC](https://discourse.julialang.org/t/questions-about-juliac/130213 "2025-06-26T01:41:11Z")

</div>

At the moment, I am trying to use julia for a real-time system. As of so far, I have done a bunch of benchmarking for julia. So the script below attempts to measure the initial time to run matrix multiplication for two …

---

## [Iterative 2D Convolution Optimization, Help?](https://discourse.julialang.org/t/iterative-2d-convolution-optimization-help/130200)

<div class="topic-metadata">

**Author:** [@GA-Brady](https://discourse.julialang.org/u/GA-Brady)\
**Replies:** 1\
**Last updated:** [June 25, 2025, 8:54pm UTC](https://discourse.julialang.org/t/iterative-2d-convolution-optimization-help/130200 "2025-06-25T20:54:35Z")

</div>

I need to write an iterative 2D convolution, i.e. Starting with a 4k sample image, run a convolution algorithm, then run the same convolution on the result. Padding is added to the image such that the result is 4K. My t…

---

## [Julia SLURM + BLAS + Multithreading, threads not mapping well leading to poor performance](https://discourse.julialang.org/t/julia-slurm-blas-multithreading-threads-not-mapping-well-leading-to-poor-performance/130188)

<div class="topic-metadata">

**Author:** [@jacksonjhayes](https://discourse.julialang.org/u/jacksonjhayes)\
**Replies:** 5\
**Last updated:** [June 25, 2025, 5:04pm UTC](https://discourse.julialang.org/t/julia-slurm-blas-multithreading-threads-not-mapping-well-leading-to-poor-performance/130188 "2025-06-25T17:04:36Z")

</div>

I am running benchmarking of a code that uses: multithreading BLAS (multithreaded) BLAS (single threaded in parallel on Julia Threads) on NERSC Perlmutter (AMD 2x \[AMD EPYC 7763\] 64 cores x 2 hyperthreads per core) …

---

## [Modifying subentries in a Vector{SVector}, @set and reinterpret](https://discourse.julialang.org/t/modifying-subentries-in-a-vector-svector-set-and-reinterpret/130178)

<div class="topic-metadata">

**Author:** [@eldee](https://discourse.julialang.org/u/eldee)\
**Replies:** 1\
**Last updated:** [June 24, 2025, 7:41pm UTC](https://discourse.julialang.org/t/modifying-subentries-in-a-vector-svector-set-and-reinterpret/130178 "2025-06-24T19:41:58Z")

</div>

Hi, Most of the time it makes conceptually more sense to store some data as a Vector{SVector{Float64, 3}} v as opposed to a Matrix{Float64} M of size (3, n). However, this makes updating (sub)entries more difficult. I.…

---

## [Multithreading a over a double for-loop with arrays](https://discourse.julialang.org/t/multithreading-a-over-a-double-for-loop-with-arrays/130033)

<div class="topic-metadata">

**Author:** [@Menno](https://discourse.julialang.org/u/Menno)\
**Replies:** 6\
**Last updated:** [June 23, 2025, 1:54pm UTC](https://discourse.julialang.org/t/multithreading-a-over-a-double-for-loop-with-arrays/130033 "2025-06-23T13:54:16Z")

</div>

Hey there, I’m trying to multithread some elaborate test over two for-loops.The important piece of code is Threads.@threads for i in 1:length(t\_values) Threads.@threads for μ in 1:P m\_values\[μ,i\]=run\_test(i, μ, t0…

---

## [Copying bytes from AbstractVector to Ptr](https://discourse.julialang.org/t/copying-bytes-from-abstractvector-to-ptr/119408)

<div class="topic-metadata">

**Author:** [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Replies:** 7\
**Last updated:** [June 21, 2025, 8:48pm UTC](https://discourse.julialang.org/t/copying-bytes-from-abstractvector-to-ptr/119408 "2025-06-21T20:48:13Z")

</div>

I am trying to efficiently copy data from an AbstractVector{UInt8} into a Ptr{UInt8} I currently have tried the following: function unsafe\_read1!( dest::Ptr{UInt8}, src::AbstractVector{UInt8}, s…

---

## [Best Practices for Julia Pipelines Handling Real‑Time IoT Sensor Streams](https://discourse.julialang.org/t/best-practices-for-julia-pipelines-handling-real-time-iot-sensor-streams/130074)

<div class="topic-metadata">

**Author:** [@ariajames](https://discourse.julialang.org/u/ariajames)\
**Replies:** 1\
**Last updated:** [June 20, 2025, 8:13pm UTC](https://discourse.julialang.org/t/best-practices-for-julia-pipelines-handling-real-time-iot-sensor-streams/130074 "2025-06-20T20:13:03Z")

</div>

Hi everyone, I’m building a real-time IoT data pipeline in Julia to process and analyze sensor information from home automation devices. Has anyone here implemented a production-ready Julia pipeline for live IoT feeds? …

---

## [Repeated linear least squares problem with large dimensions](https://discourse.julialang.org/t/repeated-linear-least-squares-problem-with-large-dimensions/130023)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 6\
**Last updated:** [June 19, 2025, 6:17pm UTC](https://discourse.julialang.org/t/repeated-linear-least-squares-problem-with-large-dimensions/130023 "2025-06-19T18:17:55Z")

</div>

Hi, I’m working with a larger algorithm in which a recurring step (done 5 - 20 times) is to carry out a linear regression y^k = X\\beta^k + \\varepsilon^k with roughly 100.000 observations and 1.000-5.000 variables, where…

---

## [ForwardDiff Allocations](https://discourse.julialang.org/t/forwarddiff-allocations/130006)

<div class="topic-metadata">

**Author:** [@elenev](https://discourse.julialang.org/u/elenev)\
**Replies:** 3\
**Last updated:** [June 19, 2025, 2:26am UTC](https://discourse.julialang.org/t/forwarddiff-allocations/130006 "2025-06-19T02:26:15Z")

</div>

I ran into a strange issue where very small changes to a non-allocating function affect whether it’s ForwardDiff.gradient! is allocating or not. Here is an MWE. It’s a vastly simplified version of my original structure,…

---

## [File zipping taking longer for large files](https://discourse.julialang.org/t/file-zipping-taking-longer-for-large-files/115963)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 16\
**Last updated:** [June 28, 2024, 2:34am UTC](https://discourse.julialang.org/t/file-zipping-taking-longer-for-large-files/115963 "2024-06-28T02:34:15Z")

</div>

I am trying to zip files in the directory which is around 300 - 400 MB and it’s taking more than 15 mins to finish. Initially I was using custom function written using ZipFile package. I have tried using Base.zip which i…

---

## [Using preallocated arrays of unknown type](https://discourse.julialang.org/t/using-preallocated-arrays-of-unknown-type/129895)

<div class="topic-metadata">

**Author:** [@Miroboru](https://discourse.julialang.org/u/Miroboru)\
**Replies:** 6\
**Last updated:** [June 16, 2025, 10:26am UTC](https://discourse.julialang.org/t/using-preallocated-arrays-of-unknown-type/129895 "2025-06-16T10:26:11Z")

</div>

I have an optimization problem where I have a function f(x) that is given to the optimizer (I use Optim.jl with the LBFGS() method). Inside this function f, I have another function g(x, y) that returns an array v. funct…

---

## [Yet another language benchmark](https://discourse.julialang.org/t/yet-another-language-benchmark/127924)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 9\
**Last updated:** [June 15, 2025, 12:13pm UTC](https://discourse.julialang.org/t/yet-another-language-benchmark/127924 "2025-06-15T12:13:00Z")

</div>

I like the visuals in this one. As usual, Julia compilation seems to be included in the results: P.S.: we don’t have a HPC category on discourse. Should it be created? The GPU and Julia at Scale categories could be su…

---

## [Is it possible to reinterpret and reshape without allocating?](https://discourse.julialang.org/t/is-it-possible-to-reinterpret-and-reshape-without-allocating/129842)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 11\
**Last updated:** [June 13, 2025, 9:18am UTC](https://discourse.julialang.org/t/is-it-possible-to-reinterpret-and-reshape-without-allocating/129842 "2025-06-13T09:18:28Z")

</div>

So I have data I’m getting over HTTP, r = rand(UInt8, 847296) It is arraigned in 3 8 byte chunks, where the first chunk is unwanted metadata, so every 3n -2 chunks is unwanted. I have written a function that does this…

---

## [Performance discrepancy for different ways of piping/composing functions for handling runtime dispatch](https://discourse.julialang.org/t/performance-discrepancy-for-different-ways-of-piping-composing-functions-for-handling-runtime-dispatch/129773)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 9\
**Last updated:** [June 13, 2025, 4:30am UTC](https://discourse.julialang.org/t/performance-discrepancy-for-different-ways-of-piping-composing-functions-for-handling-runtime-dispatch/129773 "2025-06-13T04:30:29Z")

</div>

MWE (tested on Julia 1.11.5): julia\> foo1(::Val{N}) where {N} = N foo1 (generic function with 1 method) julia\> foo2(n::Int) = Val(n) foo2 (generic function with 1 method) julia\> a = Val.(rand(Int, 1000)); julia\> usin…

---

## [Speed of \`hasmethod\` with and without kwargs](https://discourse.julialang.org/t/speed-of-hasmethod-with-and-without-kwargs/129847)

<div class="topic-metadata">

**Author:** [@mmkrusniak](https://discourse.julialang.org/u/mmkrusniak)\
**Replies:** 3\
**Last updated:** [June 12, 2025, 11:53pm UTC](https://discourse.julialang.org/t/speed-of-hasmethod-with-and-without-kwargs/129847 "2025-06-12T23:53:28Z")

</div>

I’m a novice at writing high-performance code with Julia (1.11). I have an unknown function from a user, and I want to check if it accepts any of several possible sets of keyword names. But for reasons unknown to me, ha…

---

## [PReLU with long compilation time](https://discourse.julialang.org/t/prelu-with-long-compilation-time/129783)

<div class="topic-metadata">

**Author:** [@cirobr](https://discourse.julialang.org/u/cirobr)\
**Replies:** 1\
**Last updated:** [June 12, 2025, 6:24pm UTC](https://discourse.julialang.org/t/prelu-with-long-compilation-time/129783 "2025-06-12T18:24:35Z")

</div>

Cheers, I have implemented a PReLU nonlinearity that seems to be working quite well in my models, except for the fact the model’s compilation time (\*) is way longer than the equivalent model with ReLU instead. Given my…

---

## [Julia (AcceleratedKernels) vs JAX time comparison](https://discourse.julialang.org/t/julia-acceleratedkernels-vs-jax-time-comparison/129781)

<div class="topic-metadata">

**Author:** [@mcp](https://discourse.julialang.org/u/mcp)\
**Replies:** 21\
**Last updated:** [June 11, 2025, 1:54pm UTC](https://discourse.julialang.org/t/julia-acceleratedkernels-vs-jax-time-comparison/129781 "2025-06-11T13:54:33Z")

</div>

Hi everyone! Following this topic, I’d like to understand how to write an efficient CPU/GPU agnostic code using AcceleratedKernels.jl. My problem is writing the joint PDF of two random variables, one of which is condit…

---

## [Understanding Tullio performances](https://discourse.julialang.org/t/understanding-tullio-performances/129760)

<div class="topic-metadata">

**Author:** [@mcp](https://discourse.julialang.org/u/mcp)\
**Replies:** 12\
**Last updated:** [June 10, 2025, 12:25pm UTC](https://discourse.julialang.org/t/understanding-tullio-performances/129760 "2025-06-10T12:25:57Z")

</div>

Hi everyone! I’m new to Julia and I’m trying to translate a JAX code in Julia using Tullio macro that makes the code simple and clean. However, I’m not able to get the same performances even with simple functions. Here…

---

## [NonlinearSolve with in-place mutation of intermediate variables](https://discourse.julialang.org/t/nonlinearsolve-with-in-place-mutation-of-intermediate-variables/129771)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 2\
**Last updated:** [June 9, 2025, 9:21pm UTC](https://discourse.julialang.org/t/nonlinearsolve-with-in-place-mutation-of-intermediate-variables/129771 "2025-06-09T21:21:31Z")

</div>

I’m working on an economic model involving a dynamic programming problem. Solving this problem involves mutating several large’ish (e.g., 100 x 3 x 15 x 200) arrays at each iteration. To make the code efficient, I se…

---

## [Large number of memory allocations using Dict with custom key type](https://discourse.julialang.org/t/large-number-of-memory-allocations-using-dict-with-custom-key-type/129676)

<div class="topic-metadata">

**Author:** [@erenust](https://discourse.julialang.org/u/erenust)\
**Replies:** 10\
**Last updated:** [June 7, 2025, 11:13am UTC](https://discourse.julialang.org/t/large-number-of-memory-allocations-using-dict-with-custom-key-type/129676 "2025-06-07T11:13:39Z")

</div>

As part of the code I’m working on I need to find the unique elements of a collection of small integer arrays and assign a unique identifier to each one of them. To do this I could do something like the following: array…

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

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