# Performance

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

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

**Page:** 7

---

## [Regular println vs Core.stdout](https://discourse.julialang.org/t/regular-println-vs-core-stdout/131685)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 10\
**Last updated:** [August 19, 2025, 12:38pm UTC](https://discourse.julialang.org/t/regular-println-vs-core-stdout/131685 "2025-08-19T12:38:39Z")

</div>

@time println(Core.stdout, "Hello") Hello 0.000027 seconds julia\> @time println("Hello") Hello 0.000074 seconds julia\> @time print(Core.stdout, "Hello") Hello 0.000020 seconds Why is it 3 times faster \[see my fol…

---

## [DistributedNext FYI](https://discourse.julialang.org/t/distributednext-fyi/131706)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 0\
**Last updated:** [August 19, 2025, 11:16am UTC](https://discourse.julialang.org/t/distributednext-fyi/131706 "2025-08-19T11:16:56Z")

</div>

Continuing the discussion from I want Best Practices for Working With Python & Julia Together: Yes, new to me, note “Bleeding-edge fork of Distributed.jl” and “This is a soft fork of Distributed.jl for the purposes of …

---

## [Using particle filter to estimate the state through the observations of another parameter that depends on state](https://discourse.julialang.org/t/using-particle-filter-to-estimate-the-state-through-the-observations-of-another-parameter-that-depends-on-state/131690)

<div class="topic-metadata">

**Author:** [@Tanya123](https://discourse.julialang.org/u/Tanya123)\
**Replies:** 1\
**Last updated:** [August 19, 2025, 11:42am UTC](https://discourse.julialang.org/t/using-particle-filter-to-estimate-the-state-through-the-observations-of-another-parameter-that-depends-on-state/131690 "2025-08-19T11:42:20Z")

</div>

My goal is to estimate the basal friction field (β) of a glacier using surface velocity observations. Direct observations of β are unavailable, but velocity measurements at the surface are accessible via sensors. The cu…

---

## [Thread safe memoization](https://discourse.julialang.org/t/thread-safe-memoization/131673)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 17\
**Last updated:** [August 18, 2025, 3:57pm UTC](https://discourse.julialang.org/t/thread-safe-memoization/131673 "2025-08-18T15:57:40Z")

</div>

I have the following code, using memoization: # Copyright (c) 2025 Marcus Becker, Uwe Fechner # SPDX-License-Identifier: BSD-3-Clause """ discretizeRotor(n\_rp::Int) -\> Tuple{Matrix{Float64}, Vector{Float64}} Discr…

---

## [Parallel Processing and Eigenvalue calculation](https://discourse.julialang.org/t/parallel-processing-and-eigenvalue-calculation/131659)

<div class="topic-metadata">

**Author:** [@FranciscoZick](https://discourse.julialang.org/u/FranciscoZick)\
**Replies:** 2\
**Last updated:** [August 18, 2025, 9:41am UTC](https://discourse.julialang.org/t/parallel-processing-and-eigenvalue-calculation/131659 "2025-08-18T09:41:41Z")

</div>

Hey everyone, I’m not necessarily new to Julia but new to parallel processing and writing fast code. I am trying to optimize this piece of code: BLAS.set\_num\_threads(16) MAX\_CONC = 4 # limit to 4 concurrent tasks @s…

---

## [Strategy to get best performance with @turbo and multithreading in real applications?](https://discourse.julialang.org/t/strategy-to-get-best-performance-with-turbo-and-multithreading-in-real-applications/131666)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 3\
**Last updated:** [August 18, 2025, 5:04am UTC](https://discourse.julialang.org/t/strategy-to-get-best-performance-with-turbo-and-multithreading-in-real-applications/131666 "2025-08-18T05:04:25Z")

</div>

A simple example is shown in the end of the post. It can be seen that for the smaller vectors, the multithreading in @turbo makes no difference. For the larger vectors, increasing nthreads will enhance the performance, b…

---

## [Help to build a django-like orm in julia](https://discourse.julialang.org/t/help-to-build-a-django-like-orm-in-julia/105091)

<div class="topic-metadata">

**Author:** [@Rafael\_Brus](https://discourse.julialang.org/u/Rafael_Brus)\
**Replies:** 7\
**Last updated:** [August 17, 2025, 12:47pm UTC](https://discourse.julialang.org/t/help-to-build-a-django-like-orm-in-julia/105091 "2025-08-17T12:47:42Z")

</div>

I’m spending some time these last days studying the viability of building a Django-like orm in julia. I made some progress, but I haven’t had much luck with the performance. I’ve used the searchlight with the start point…

---

## [Why has simple threading using \`threadid\` become so complex in v1.12...?](https://discourse.julialang.org/t/why-has-simple-threading-using-threadid-become-so-complex-in-v1-12/129135)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 39\
**Last updated:** [August 15, 2025, 9:50pm UTC](https://discourse.julialang.org/t/why-has-simple-threading-using-threadid-become-so-complex-in-v1-12/129135 "2025-08-15T21:50:30Z")

</div>

Hi, several of my repos got raised an issue for the upcoming v1.12 and changes to multithreading, notifying of erroneous usage of threadid. E.g., Likely erroneous use of \`Threads.nthreads\` and \`Threads.threadid\` · Issue …

---

## [No more threadid indexing? \[thread-local storage\]](https://discourse.julialang.org/t/no-more-threadid-indexing-thread-local-storage/131535)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 36\
**Last updated:** [August 15, 2025, 5:12am UTC](https://discourse.julialang.org/t/no-more-threadid-indexing-thread-local-storage/131535 "2025-08-15T05:12:13Z")

</div>

I am implementing multi-threaded scientific software, an so far it works quite well. But now I am told that thread-local storage is no longer supported by Julia. Well, it still works, even under Julia 1.12rc1, but i am …

---

## [Strange GC issue on Julia 1.12-rc1](https://discourse.julialang.org/t/strange-gc-issue-on-julia-1-12-rc1/131529)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 9\
**Last updated:** [August 12, 2025, 9:07pm UTC](https://discourse.julialang.org/t/strange-gc-issue-on-julia-1-12-rc1/131529 "2025-08-12T21:07:17Z")

</div>

I am happy that I can now use multi-threading on Julia 1.12rc1. I had to do some changes to my code, but now it works. But the garbage collector behaves differently. I am using two different settings. First settings: j…

---

## [Struct copy with change in the value of fields](https://discourse.julialang.org/t/struct-copy-with-change-in-the-value-of-fields/19592)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 8\
**Last updated:** [August 14, 2025, 12:33am UTC](https://discourse.julialang.org/t/struct-copy-with-change-in-the-value-of-fields/19592 "2025-08-14T00:33:29Z")

</div>

Hi, I have an anoying situation where I want to copy a variable of composed type by changing a value of the field which may in turn change the type. Here is an example # in my application, the following struct contain…

---

## [Broad phase Collision detection: Bitboard approach](https://discourse.julialang.org/t/broad-phase-collision-detection-bitboard-approach/131512)

<div class="topic-metadata">

**Author:** [@Gesee](https://discourse.julialang.org/u/Gesee)\
**Replies:** 30\
**Last updated:** [August 12, 2025, 12:45pm UTC](https://discourse.julialang.org/t/broad-phase-collision-detection-bitboard-approach/131512 "2025-08-12T12:45:48Z")

</div>

I have recently tried a new approach to detect potential collisions in a 2D space, just for the broad phase (In this phase we just try to quickly reduce the number of potential collision to check) so I have come up with …

---

## [Help with optimising a simple function](https://discourse.julialang.org/t/help-with-optimising-a-simple-function/131459)

<div class="topic-metadata">

**Author:** [@Tbl](https://discourse.julialang.org/u/Tbl)\
**Replies:** 21\
**Last updated:** [August 8, 2025, 6:56pm UTC](https://discourse.julialang.org/t/help-with-optimising-a-simple-function/131459 "2025-08-08T18:56:18Z")

</div>

Recently my colleagues asked me to translate my code for estimation to Python. Making it run with any reasonable speed was truly a pain and advertisement for Julia, but at the end it became few times faster with numba. I…

---

## [Type-Stable Function to Return Plots.Plot](https://discourse.julialang.org/t/type-stable-function-to-return-plots-plot/131359)

<div class="topic-metadata">

**Author:** [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Replies:** 9\
**Last updated:** [August 6, 2025, 6:11pm UTC](https://discourse.julialang.org/t/type-stable-function-to-return-plots-plot/131359 "2025-08-06T18:11:25Z")

</div>

The question below was already raised at This post. This code using Plots function foo() #..Initialize the plot.. p = plot() return p end function gnu() #..Initialize the plot.. p = …

---

## [Questions about Simplification and Performance in Symbolics.jl](https://discourse.julialang.org/t/questions-about-simplification-and-performance-in-symbolics-jl/130942)

<div class="topic-metadata">

**Author:** [@Maysam\_Gholampour](https://discourse.julialang.org/u/Maysam_Gholampour)\
**Replies:** 0\
**Last updated:** [July 22, 2025, 1:07pm UTC](https://discourse.julialang.org/t/questions-about-simplification-and-performance-in-symbolics-jl/130942 "2025-07-22T13:07:01Z")

</div>

Dear all, I have two questions regarding the use of Symbolics.jl, particularly around simplification and performance behavior. 1. Mathematical Identity Simplification It seems that Symbolics.jl does not simplify certa…

---

## [Unexpected allocations when passing types as arguments](https://discourse.julialang.org/t/unexpected-allocations-when-passing-types-as-arguments/131230)

<div class="topic-metadata">

**Author:** [@zmorrell](https://discourse.julialang.org/u/zmorrell)\
**Replies:** 8\
**Last updated:** [July 31, 2025, 5:52pm UTC](https://discourse.julialang.org/t/unexpected-allocations-when-passing-types-as-arguments/131230 "2025-07-31T17:52:52Z")

</div>

I have come across some somewhat unexpected behavior when passing types as arguments to a function. For reference, I am using the current Julia 1.10.10 (the current LTS). I am somewhat unclear what causes this behavior…

---

## [Using the result of NonlinearSolve.jl allocates memory](https://discourse.julialang.org/t/using-the-result-of-nonlinearsolve-jl-allocates-memory/131242)

<div class="topic-metadata">

**Author:** [@Gako](https://discourse.julialang.org/u/Gako)\
**Replies:** 3\
**Last updated:** [July 31, 2025, 10:41am UTC](https://discourse.julialang.org/t/using-the-result-of-nonlinearsolve-jl-allocates-memory/131242 "2025-07-31T10:41:09Z")

</div>

I’m using the following code to try and understand how broadcasting and allocation work in Julia: using NonlinearSolve function nonlin() nonlinprob(x, p) = return x - 3 prob = NonlinearProblem(nonlinprob, 2.) …

---

## [Terribly unoptimized combination of multiset\_permutations() and Iterators.product()](https://discourse.julialang.org/t/terribly-unoptimized-combination-of-multiset-permutations-and-iterators-product/130714)

<div class="topic-metadata">

**Author:** [@jonbir](https://discourse.julialang.org/u/jonbir)\
**Replies:** 9\
**Last updated:** [July 29, 2025, 11:42pm UTC](https://discourse.julialang.org/t/terribly-unoptimized-combination-of-multiset-permutations-and-iterators-product/130714 "2025-07-29T23:42:34Z")

</div>

Since I got great feedback on my first post, I turn to you again with another question. In my larger code base I want to iterate over a special kind of binary matrices. First fact about the binary matrices, they have ex…

---

## [DifferentiationInterface+ForwardDiff unable to diff ldiv! (any other options to solve linear system w/o allocations and differentiate?)](https://discourse.julialang.org/t/differentiationinterface-forwarddiff-unable-to-diff-ldiv-any-other-options-to-solve-linear-system-w-o-allocations-and-differentiate/131076)

<div class="topic-metadata">

**Author:** [@r0uv3n](https://discourse.julialang.org/u/r0uv3n)\
**Replies:** 34\
**Last updated:** [July 28, 2025, 4:30pm UTC](https://discourse.julialang.org/t/differentiationinterface-forwarddiff-unable-to-diff-ldiv-any-other-options-to-solve-linear-system-w-o-allocations-and-differentiate/131076 "2025-07-28T16:30:11Z")

</div>

I have a function where both a matrix g as well as a vector q depend on some vector input p. On the way I need to solve for g^{-1} q. I want to use DifferentiationInterface+AutoForwardDiff to take derivatives of this fu…

---

## [Help optimizing my generic sigma clipping function in Julia](https://discourse.julialang.org/t/help-optimizing-my-generic-sigma-clipping-function-in-julia/131132)

<div class="topic-metadata">

**Author:** [@Matt\_jl](https://discourse.julialang.org/u/Matt_jl)\
**Replies:** 2\
**Last updated:** [July 28, 2025, 5:36pm UTC](https://discourse.julialang.org/t/help-optimizing-my-generic-sigma-clipping-function-in-julia/131132 "2025-07-28T17:36:14Z")

</div>

Hi everyone, I’m working on a small personal project and wrote this sigma clipping function in Julia. It works fine so far, but I’m definitely not an expert and I feel like it could be way more efficient — especially to…

---

## [TTSX: Recompilation on every run](https://discourse.julialang.org/t/ttsx-recompilation-on-every-run/131003)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 9\
**Last updated:** [July 25, 2025, 12:11pm UTC](https://discourse.julialang.org/t/ttsx-recompilation-on-every-run/131003 "2025-07-25T12:11:20Z")

</div>

Colleagues and I are developing Muscade.jl. Muscade is deliberately putting a high workload on the Julia 1.11 compiler. I have done nothing with module precompilation so far. Thus I have a significant TTFX, but this i…

---

## [Why is accessing an SMatrix from a struct allocating?](https://discourse.julialang.org/t/why-is-accessing-an-smatrix-from-a-struct-allocating/131016)

<div class="topic-metadata">

**Author:** [@r0uv3n](https://discourse.julialang.org/u/r0uv3n)\
**Replies:** 4\
**Last updated:** [July 24, 2025, 7:04pm UTC](https://discourse.julialang.org/t/why-is-accessing-an-smatrix-from-a-struct-allocating/131016 "2025-07-24T19:04:08Z")

</div>

Considering the following simple MWE: using StaticArrays, BenchmarkTools struct SomeStruct matrix::SMatrix{3,3,Float64} end function testing\_allocation(g::MMatrix{3,3,Float64}, struct\_matrix::SomeStruct) fill!(g,…

---

## [How to parallelize \`lu!\` factorization?](https://discourse.julialang.org/t/how-to-parallelize-lu-factorization/130933)

<div class="topic-metadata">

**Author:** [@Leon\_Lampret](https://discourse.julialang.org/u/Leon_Lampret)\
**Replies:** 15\
**Last updated:** [July 22, 2025, 8:40pm UTC](https://discourse.julialang.org/t/how-to-parallelize-lu-factorization/130933 "2025-07-22T20:40:05Z")

</div>

I have a generic implementation of the LU factorization of a rectangular matrix: function \_swap\_col!(X, j1, j2) @inbounds begin m=size(X,1); (j1==j2 || m\<1) && return nothing; @simd for i=1:m…

---

## [How best to preallocate memory for repeated use](https://discourse.julialang.org/t/how-best-to-preallocate-memory-for-repeated-use/130814)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 5\
**Last updated:** [July 22, 2025, 4:21pm UTC](https://discourse.julialang.org/t/how-best-to-preallocate-memory-for-repeated-use/130814 "2025-07-22T16:21:41Z")

</div>

Hello, I’m trying to reduce memory allocations. The pattern is simple: I need to redo a similar problem that requires a fair bit of memory many times. So I’m preallocating sufficient memory for the largest problem and…

---

## [Nothing values in constraints](https://discourse.julialang.org/t/nothing-values-in-constraints/130937)

<div class="topic-metadata">

**Author:** [@Henk\_de\_Man](https://discourse.julialang.org/u/Henk_de_Man)\
**Replies:** 4\
**Last updated:** [July 22, 2025, 2:28pm UTC](https://discourse.julialang.org/t/nothing-values-in-constraints/130937 "2025-07-22T14:28:51Z")

</div>

How to handle variables that have “null” value, in constraint expressions. For example in Excel when we have an expression a\*b + c, and b = empty, then Excel will just return c. How can we handle such expressions in cons…

---

## [Fixed-structure CHOLMOD with in-place \`set\_nonzeros!\`](https://discourse.julialang.org/t/fixed-structure-cholmod-with-in-place-set-nonzeros/130922)

<div class="topic-metadata">

**Author:** [@luke-kiernan](https://discourse.julialang.org/u/luke-kiernan)\
**Replies:** 3\
**Last updated:** [July 22, 2025, 3:03am UTC](https://discourse.julialang.org/t/fixed-structure-cholmod-with-in-place-set-nonzeros/130922 "2025-07-22T03:03:22Z")

</div>

I have a large sparse matrix. Its nonzeros change over the course of the problem, but its structure doesn’t. I want to do repeated in-place Cholesky factorizations, re-using the symbolic factorization and modifying the n…

---

## [Making Jacobi symbol function faster](https://discourse.julialang.org/t/making-jacobi-symbol-function-faster/122141)

<div class="topic-metadata">

**Author:** [@Janis\_Erdmanis](https://discourse.julialang.org/u/Janis_Erdmanis)\
**Replies:** 12\
**Last updated:** [July 17, 2025, 7:33pm UTC](https://discourse.julialang.org/t/making-jacobi-symbol-function-faster/122141 "2025-07-17T19:33:52Z")

</div>

After wrapping amazingly fast OpenSSL for group operations (see OpenSSLGroups.jl), I found a new bottleneck for proof of shuffle verification in ShuffleProofs.jl. Half of the time my code now spends computing a Jacobi sy…

---

## [Combinatorics.permutations creating a lot of allocations](https://discourse.julialang.org/t/combinatorics-permutations-creating-a-lot-of-allocations/130665)

<div class="topic-metadata">

**Author:** [@jonbir](https://discourse.julialang.org/u/jonbir)\
**Replies:** 6\
**Last updated:** [July 14, 2025, 9:30pm UTC](https://discourse.julialang.org/t/combinatorics-permutations-creating-a-lot-of-allocations/130665 "2025-07-14T21:30:23Z")

</div>

This is my first post here, so I hope I can explain the problem I’ve come across as I’m writing code for my master thesis in Maths. Compared to others here I’m definitely no expert, but I trusted code from Packages to gi…

---

## [The issues of frequent recompilation and low computational efficiency in ITensor.jl](https://discourse.julialang.org/t/the-issues-of-frequent-recompilation-and-low-computational-efficiency-in-itensor-jl/130678)

<div class="topic-metadata">

**Author:** [@Hanze\_Li](https://discourse.julialang.org/u/Hanze_Li)\
**Replies:** 18\
**Last updated:** [July 14, 2025, 3:46pm UTC](https://discourse.julialang.org/t/the-issues-of-frequent-recompilation-and-low-computational-efficiency-in-itensor-jl/130678 "2025-07-14T15:46:24Z")

</div>

I’m a beginner in Julia and I’m using ITensor.jl for computations in my project. However, I’ve noticed that the program runs with very low efficiency, and both CPU and memory usage are minimal. I’m not sure how to optimi…

---

## [Why is broadcast of getproperty so slow?](https://discourse.julialang.org/t/why-is-broadcast-of-getproperty-so-slow/129970)

<div class="topic-metadata">

**Author:** [@mwlidar](https://discourse.julialang.org/u/mwlidar)\
**Replies:** 13\
**Last updated:** [July 13, 2025, 5:53pm UTC](https://discourse.julialang.org/t/why-is-broadcast-of-getproperty-so-slow/129970 "2025-07-13T17:53:58Z")

</div>

Looking on the following code I found that a simple broadcast of getproperty is about two to three times slower than a simple for loop implementation: struct MyStruct x::Float64 y::Float64 z::Float64 end #x…

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

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