# Performance

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

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

**Page:** 21

---

## [Same multi-threaded code, scaling observed only on some machines](https://discourse.julialang.org/t/same-multi-threaded-code-scaling-observed-only-on-some-machines/118200)

<div class="topic-metadata">

**Author:** [@EdTi](https://discourse.julialang.org/u/EdTi)\
**Replies:** 2\
**Last updated:** [August 14, 2024, 8:02pm UTC](https://discourse.julialang.org/t/same-multi-threaded-code-scaling-observed-only-on-some-machines/118200 "2024-08-14T20:02:48Z")

</div>

Hi everyone, I was quite surprised by the following benchmark.The goal is the following : initialize a big vector x, and try to add 1 to all of its coordinates as fast as possible, taking advantage of multi-threading. H…

---

## [How to reuse julia compiled cache across machines?](https://discourse.julialang.org/t/how-to-reuse-julia-compiled-cache-across-machines/117149)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 8\
**Last updated:** [August 14, 2024, 10:54am UTC](https://discourse.julialang.org/t/how-to-reuse-julia-compiled-cache-across-machines/117149 "2024-08-14T10:54:55Z")

</div>

Hello, I’d like to cache the julia package compilation in an external volume which can be read and written to by multiple clients (using a respective kubernetes volume) . My question is whether it is enough to bring t…

---

## [Seeking Insights: Approaches for Implementing Real-Time AI Analytics in Julia](https://discourse.julialang.org/t/seeking-insights-approaches-for-implementing-real-time-ai-analytics-in-julia/118163)

<div class="topic-metadata">

**Author:** [@adelenoble](https://discourse.julialang.org/u/adelenoble)\
**Replies:** 0\
**Last updated:** [August 14, 2024, 7:18am UTC](https://discourse.julialang.org/t/seeking-insights-approaches-for-implementing-real-time-ai-analytics-in-julia/118163 "2024-08-14T07:18:11Z")

</div>

Hello community, I am exploring the implementation of real-time AI analytic using the Julia programming language and would love to gather insights from those with experience in this area. Specifically, I am interested …

---

## [\[Turing.jl\] Understanding running times in Turing.jl? Beyond @time](https://discourse.julialang.org/t/turing-jl-understanding-running-times-in-turing-jl-beyond-time/118154)

<div class="topic-metadata">

**Author:** [@FJRubio](https://discourse.julialang.org/u/FJRubio)\
**Replies:** 1\
**Last updated:** [August 13, 2024, 6:29pm UTC](https://discourse.julialang.org/t/turing-jl-understanding-running-times-in-turing-jl-beyond-time/118154 "2024-08-13T18:29:16Z")

</div>

This is a general question about understanding running times in sample() from Turing.jl when I know how long it takes to evaluate a custom log-likelihood function. I have a custom log-likelihood function, my\_loglik(), f…

---

## [Ray Tracing in a week-end - Julia vs SIMD-optimized C++](https://discourse.julialang.org/t/ray-tracing-in-a-week-end-julia-vs-simd-optimized-c/72958)

<div class="topic-metadata">

**Author:** [@claforte](https://discourse.julialang.org/u/claforte)\
**Replies:** 81\
**Last updated:** [August 9, 2024, 6:36pm UTC](https://discourse.julialang.org/t/ray-tracing-in-a-week-end-julia-vs-simd-optimized-c/72958 "2024-08-09T18:36:10Z")

</div>

Hi folks, As an exercise to learn how to optimize Julia code for performance, I adapted from C++ to Julia a popular raytracing “book” (Ray Tracing In One Weekend by Peter Shirley) into a Pluto.jl notebook. Hopefully thi…

---

## [Is this Makie file not parseable by JuliaSyntax.jl?](https://discourse.julialang.org/t/is-this-makie-file-not-parseable-by-juliasyntax-jl/117997)

<div class="topic-metadata">

**Author:** [@Sixzero](https://discourse.julialang.org/u/Sixzero)\
**Replies:** 3\
**Last updated:** [August 10, 2024, 12:02pm UTC](https://discourse.julialang.org/t/is-this-makie-file-not-parseable-by-juliasyntax-jl/117997 "2024-08-10T12:02:34Z")

</div>

I just tried to parse the file: file\_path = ~/.julia/packages/Makie/rEu75/src/Makie.jl @info "Processing file: $file\_path" s = read(file\_path, String) @time expr2 = parsestmt(JuliaSyntax.SyntaxNode, "begin\\n"\*s\*"\\nend"…

---

## [Optimize splitting vector of strings](https://discourse.julialang.org/t/optimize-splitting-vector-of-strings/117924)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 10\
**Last updated:** [August 8, 2024, 1:27pm UTC](https://discourse.julialang.org/t/optimize-splitting-vector-of-strings/117924 "2024-08-08T13:27:50Z")

</div>

I am learning how to optimize julia code and came up with the following MWE: using BenchmarkTools, Profile strvec = \["AA entryA", "BBC entryB", "CCM entryC"\] function split\_vec(strvec) mat = stack(split.(strvec),…

---

## [Square-Root Kalman-Filter: Calculate only upper triangular of QR-decomposition](https://discourse.julialang.org/t/square-root-kalman-filter-calculate-only-upper-triangular-of-qr-decomposition/55621)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 9\
**Last updated:** [August 8, 2024, 1:23pm UTC](https://discourse.julialang.org/t/square-root-kalman-filter-calculate-only-upper-triangular-of-qr-decomposition/55621 "2024-08-08T13:23:54Z")

</div>

I’m implementing the Square-Root Kalman-Filter similar to this python implementation: Python - Square-Root Kalman-Filter The implementation calculates the QR-decomposition, but it only needs the upper triangular matrix…

---

## [Get Literate.jl to ignore docstrings](https://discourse.julialang.org/t/get-literate-jl-to-ignore-docstrings/117951)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 4\
**Last updated:** [August 8, 2024, 12:41pm UTC](https://discourse.julialang.org/t/get-literate-jl-to-ignore-docstrings/117951 "2024-08-08T12:41:03Z")

</div>

How do I get Literate.jl to ignore docstrings? I have a \*.jl file defining functions. The functions have docstrings """ z = foo(x,y) Great functionality, easy to use. """ (parsed by Documenter.jl to generate the “r…

---

## [Spending a lot of time in \`materialize\` called by \`findall\`](https://discourse.julialang.org/t/spending-a-lot-of-time-in-materialize-called-by-findall/117859)

<div class="topic-metadata">

**Author:** [@Oblomov](https://discourse.julialang.org/u/Oblomov)\
**Replies:** 14\
**Last updated:** [August 7, 2024, 6:01am UTC](https://discourse.julialang.org/t/spending-a-lot-of-time-in-materialize-called-by-findall/117859 "2024-08-07T06:01:08Z")

</div>

Hello all, I’m new to Julia and as an exercise I’ve ported a medium-complex Python code to Julia. Even without particular optimizations, the Julia code is 4 to 5 times faster than Python (nice!), but I’ve decided to try…

---

## [Memory allocation during assignment and modification of Float64 variables](https://discourse.julialang.org/t/memory-allocation-during-assignment-and-modification-of-float64-variables/117856)

<div class="topic-metadata">

**Author:** [@Adam\_Mendl](https://discourse.julialang.org/u/Adam_Mendl)\
**Replies:** 3\
**Last updated:** [August 6, 2024, 9:47am UTC](https://discourse.julialang.org/t/memory-allocation-during-assignment-and-modification-of-float64-variables/117856 "2024-08-06T09:47:04Z")

</div>

Hello, I have come across really puzzling (at least for me) output of julia --track-allocation=user. After playing with my code and outputs of benchmarking tools, I have ended up with the following snippet of \*.mem file,…

---

## [Compiler optimizations around DataFrames](https://discourse.julialang.org/t/compiler-optimizations-around-dataframes/117864)

<div class="topic-metadata">

**Author:** [@Kirby\_Zhang](https://discourse.julialang.org/u/Kirby_Zhang)\
**Replies:** 1\
**Last updated:** [August 6, 2024, 8:48am UTC](https://discourse.julialang.org/t/compiler-optimizations-around-dataframes/117864 "2024-08-06T08:48:52Z")

</div>

I understand that to get type stable code using DataFrames.jl, you need to use Tables.columntable to convert the DF into NamedTuple. I was working on a Pluto notebook that tried to show the memory allocation behavior, bu…

---

## [Integer (\`Int64\`) factorization: Julia code is extremely slow](https://discourse.julialang.org/t/integer-int64-factorization-julia-code-is-extremely-slow/117819)

<div class="topic-metadata">

**Author:** [@xinwu](https://discourse.julialang.org/u/xinwu)\
**Replies:** 7\
**Last updated:** [August 5, 2024, 11:24am UTC](https://discourse.julialang.org/t/integer-int64-factorization-julia-code-is-extremely-slow/117819 "2024-08-05T11:24:37Z")

</div>

Hi, are there any mistakes in my Julia code for integer (Int64) factorization? C++ code finishes instantly. Julia code seems to run forever. Here are the codes. Thank you for your hints! #include \<iostream\> #include \<…

---

## [Repeated contractions - Vector-of-StaticArrays vs HybridArrays.jl, discrepancy in performance between Float64 vs Float32](https://discourse.julialang.org/t/repeated-contractions-vector-of-staticarrays-vs-hybridarrays-jl-discrepancy-in-performance-between-float64-vs-float32/117794)

<div class="topic-metadata">

**Author:** [@jl\_enthusiast](https://discourse.julialang.org/u/jl_enthusiast)\
**Replies:** 9\
**Last updated:** [August 4, 2024, 11:50pm UTC](https://discourse.julialang.org/t/repeated-contractions-vector-of-staticarrays-vs-hybridarrays-jl-discrepancy-in-performance-between-float64-vs-float32/117794 "2024-08-04T23:50:55Z")

</div>

Hi, I am doing some pre-emptive benchmarking for a larger project. As part of it, I am checking the most optimal way to store N pre-computed 3x3 matrices which we use to contract N 3-length vectors with. I represent the…

---

## [Probable data race condition causing problems when trying to parallelize a loop used to populate an array](https://discourse.julialang.org/t/probable-data-race-condition-causing-problems-when-trying-to-parallelize-a-loop-used-to-populate-an-array/117733)

<div class="topic-metadata">

**Author:** [@Uranium238](https://discourse.julialang.org/u/Uranium238)\
**Replies:** 14\
**Last updated:** [August 4, 2024, 9:35am UTC](https://discourse.julialang.org/t/probable-data-race-condition-causing-problems-when-trying-to-parallelize-a-loop-used-to-populate-an-array/117733 "2024-08-04T09:35:58Z")

</div>

I am trying to parallelize a part of my code where different values of an array x are populated asynchronously. The serial function of my full code is as follows using Distributed using MKL using DelimitedFiles using Li…

---

## [LoadError: Couldn't find libpython PyCall](https://discourse.julialang.org/t/loaderror-couldnt-find-libpython-pycall/16074)

<div class="topic-metadata">

**Author:** [@MMalakhov](https://discourse.julialang.org/u/MMalakhov)\
**Replies:** 7\
**Last updated:** [August 1, 2024, 8:15pm UTC](https://discourse.julialang.org/t/loaderror-couldnt-find-libpython-pycall/16074 "2024-08-01T20:15:52Z")

</div>

I can’t build PyCall on linux mint 18.3 julia\> Pkg.build(“PyCall”) Building Conda ─→ ~/.julia/packages/Conda/hsaaN/deps/build.log Building PyCall → ~/.julia/packages/PyCall/rUul9/deps/build.log ┌ Error: Error buildi…

---

## [Best way to generate vector of tuples based on two vectors](https://discourse.julialang.org/t/best-way-to-generate-vector-of-tuples-based-on-two-vectors/117687)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 4\
**Last updated:** [July 31, 2024, 5:58pm UTC](https://discourse.julialang.org/t/best-way-to-generate-vector-of-tuples-based-on-two-vectors/117687 "2024-07-31T17:58:21Z")

</div>

The following does what I want, generate a vector of tuples thanks to the two vectors that I provide. xycoordinates = Tuple{Int,Int}\[(x,y) for x in collect(1:10), y in rand(1:10, 10)\] I wanted to know if there exists a…

---

## [How to improve efficiency of my linear algebra code (matrix equivalency)](https://discourse.julialang.org/t/how-to-improve-efficiency-of-my-linear-algebra-code-matrix-equivalency/110572)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 33\
**Last updated:** [July 29, 2024, 8:23pm UTC](https://discourse.julialang.org/t/how-to-improve-efficiency-of-my-linear-algebra-code-matrix-equivalency/110572 "2024-07-29T20:23:20Z")

</div>

I wish to write a function decompose\_diag\_over\_field! that, given an mxn matrix X over a field, decomposes it in-place as X=U\*D\*V, where D is a diagonal mxn matrix and U,V are invertible mxm and nxn matrices, with inver…

---

## [Exponentiation of floats](https://discourse.julialang.org/t/exponentiation-of-floats/105951)

<div class="topic-metadata">

**Author:** [@richard\_sti](https://discourse.julialang.org/u/richard_sti)\
**Replies:** 25\
**Last updated:** [July 26, 2024, 10:52pm UTC](https://discourse.julialang.org/t/exponentiation-of-floats/105951 "2024-07-26T22:52:01Z")

</div>

Hi, I noticed that there is a significant loss of performance between Julia 1.7.3 and 1.9.x for exponentiation of floats, which becomes ~ 5 times slower. I tested this independently on a few machines. A minimal example o…

---

## [How to measure the time taken by a part of the code excluding the disk operations](https://discourse.julialang.org/t/how-to-measure-the-time-taken-by-a-part-of-the-code-excluding-the-disk-operations/117469)

<div class="topic-metadata">

**Author:** [@Uranium238](https://discourse.julialang.org/u/Uranium238)\
**Replies:** 5\
**Last updated:** [July 26, 2024, 9:30am UTC](https://discourse.julialang.org/t/how-to-measure-the-time-taken-by-a-part-of-the-code-excluding-the-disk-operations/117469 "2024-07-26T09:30:33Z")

</div>

I am trying to write a code that deals with repeated deserialization of tensors followed by contracting them and storing the result in another tensor. Here is an example of how the code looks like : I\_vvoo = zeros(F…

---

## [Bad performances when using Multithreading and Distributed with heavy LinearAlgebra calculations](https://discourse.julialang.org/t/bad-performances-when-using-multithreading-and-distributed-with-heavy-linearalgebra-calculations/117258)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 26\
**Last updated:** [July 25, 2024, 10:59pm UTC](https://discourse.julialang.org/t/bad-performances-when-using-multithreading-and-distributed-with-heavy-linearalgebra-calculations/117258 "2024-07-25T22:59:58Z")

</div>

Hello, I have noticed that Julia multithreading and Distributed scale very badly when calculating relatively heavy computations involving BLAS and LAPACK. As an example, here I show you the calculation of the expv funct…

---

## [Type Inference of many dynamically created NamedTuples](https://discourse.julialang.org/t/type-inference-of-many-dynamically-created-namedtuples/117464)

<div class="topic-metadata">

**Author:** [@olivierlabayle](https://discourse.julialang.org/u/olivierlabayle)\
**Replies:** 6\
**Last updated:** [July 25, 2024, 12:44pm UTC](https://discourse.julialang.org/t/type-inference-of-many-dynamically-created-namedtuples/117464 "2024-07-25T12:44:18Z")

</div>

Hi, I am facing a compilation bottleneck in my code because I am creating and propagating a large collection of NamedTuples, each with different keys. This seems to cause type inference problems. I have created the fol…

---

## [LoopVec, Tullio losing to Matrix multiplication](https://discourse.julialang.org/t/loopvec-tullio-losing-to-matrix-multiplication/115798)

<div class="topic-metadata">

**Author:** [@ditfurth](https://discourse.julialang.org/u/ditfurth)\
**Replies:** 9\
**Last updated:** [July 25, 2024, 4:51am UTC](https://discourse.julialang.org/t/loopvec-tullio-losing-to-matrix-multiplication/115798 "2024-07-25T04:51:01Z")

</div>

Hi all, I provide a simple mwe below #MWE using BenchmarkTools, Random, Distributions, Base.Threads, Tullio, LoopVectorization Random.seed!(123) s\_ijt = randn(3000,100)\*0.0005 .+ 0.1 gamma\_empty = zeros(size(s\_ijt,1)…

---

## [Reduce allocation in nested for loops](https://discourse.julialang.org/t/reduce-allocation-in-nested-for-loops/117428)

<div class="topic-metadata">

**Author:** [@EthanN](https://discourse.julialang.org/u/EthanN)\
**Replies:** 2\
**Last updated:** [July 24, 2024, 8:46pm UTC](https://discourse.julialang.org/t/reduce-allocation-in-nested-for-loops/117428 "2024-07-24T20:46:29Z")

</div>

I have a function that calculates the expectation and covariance of random variables on a grid with dimensions (nx, ny, nz). The variables y and z are Markovian, with Qy and Qz being their Markov matrices. Functions f an…

---

## [Serious issue: Julia language Keyboard Lag Typing Very Slow](https://discourse.julialang.org/t/serious-issue-julia-language-keyboard-lag-typing-very-slow/32081)

<div class="topic-metadata">

**Author:** [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Replies:** 55\
**Last updated:** [July 23, 2024, 4:01pm UTC](https://discourse.julialang.org/t/serious-issue-julia-language-keyboard-lag-typing-very-slow/32081 "2024-07-23T16:01:26Z")

</div>

PROBLEM I am writing a long Julia code: https://github.com/joseph-pollacco/SoilWaterToolbox After I run Julia code either directly from Visual Studio Code or from the Julia REPL the typing becomes incredibly slow. The…

---

## [Case study: Real time hardware control for adaptive optics with Julia](https://discourse.julialang.org/t/case-study-real-time-hardware-control-for-adaptive-optics-with-julia/117155)

<div class="topic-metadata">

**Author:** [@sefffal](https://discourse.julialang.org/u/sefffal)\
**Replies:** 9\
**Last updated:** [July 23, 2024, 3:29pm UTC](https://discourse.julialang.org/t/case-study-real-time-hardware-control-for-adaptive-optics-with-julia/117155 "2024-07-23T15:29:10Z")

</div>

\[not sure this is the best category, mods feel free to move\] Hi all, I wanted to share our recent conference proceeding on using Julia in a real time application: \[2407.07207\] Real-time adaptive optics control with a h…

---

## [What is the recommended way to filter rows of a Dataframe?](https://discourse.julialang.org/t/what-is-the-recommended-way-to-filter-rows-of-a-dataframe/117367)

<div class="topic-metadata">

**Author:** [@curious](https://discourse.julialang.org/u/curious)\
**Replies:** 6\
**Last updated:** [July 23, 2024, 1:15pm UTC](https://discourse.julialang.org/t/what-is-the-recommended-way-to-filter-rows-of-a-dataframe/117367 "2024-07-23T13:15:48Z")

</div>

Hello, I am asking for recommendations/tips on how to filter rows of a dataframe. I was using filter for sometime. But it seems inefficient/slow compared to subsetting dataframe using other methods. Here are benchmarks …

---

## [Parallel Computing with Threads.@threads in HPC is slow?](https://discourse.julialang.org/t/parallel-computing-with-threads-threads-in-hpc-is-slow/112591)

<div class="topic-metadata">

**Author:** [@Van\_Sy\_Tnut](https://discourse.julialang.org/u/Van_Sy_Tnut)\
**Replies:** 12\
**Last updated:** [July 21, 2024, 9:24pm UTC](https://discourse.julialang.org/t/parallel-computing-with-threads-threads-in-hpc-is-slow/112591 "2024-07-21T21:24:17Z")

</div>

Hello everyone! I am wondering why parallel computing with “Threads.@threads” in my own PC is faster than that in HPC? Although the maximum number of “Threads.nthreads()” I can set up in my PC is only 16 while in HPC I…

---

## [Solving EnsembleProblem efficiently for large systems: memory issues](https://discourse.julialang.org/t/solving-ensembleproblem-efficiently-for-large-systems-memory-issues/116146)

<div class="topic-metadata">

**Author:** [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Replies:** 10\
**Last updated:** [July 19, 2024, 9:03am UTC](https://discourse.julialang.org/t/solving-ensembleproblem-efficiently-for-large-systems-memory-issues/116146 "2024-07-19T09:03:45Z")

</div>

I apologize in advance for this length thread, but the problem setting is relatively complicated and this was the smallest MWE that I could think of, while still remaining clear. Problem setting I am encountering some i…

---

## [SIMD: Need some help to speed up sampling a code vector](https://discourse.julialang.org/t/simd-need-some-help-to-speed-up-sampling-a-code-vector/117075)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 28\
**Last updated:** [July 16, 2024, 9:44pm UTC](https://discourse.julialang.org/t/simd-need-some-help-to-speed-up-sampling-a-code-vector/117075 "2024-07-16T21:44:15Z")

</div>

This is part of my work to implement a GNSS receiver in real time (see GNSSReceiver.jl). One crucial part is the code generation that functions as a matched filter. The code is binary and can be modeled as code = Int3…

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

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