# Performance

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

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

**Page:** 48

---

## [PyPlot Scatter-Plot Performance](https://discourse.julialang.org/t/pyplot-scatter-plot-performance/94129)

<div class="topic-metadata">

**Author:** [@ratwolf](https://discourse.julialang.org/u/ratwolf)\
**Replies:** 12\
**Last updated:** [March 6, 2023, 1:27pm UTC](https://discourse.julialang.org/t/pyplot-scatter-plot-performance/94129 "2023-03-06T13:27:38Z")

</div>

I wrote a small program to display the “Hopalong Attractor”. The calculations themselves are relatively fast, as is the scatter plot if you only use a single color. Coloring the scatterplot as a function of the distance…

---

## [Learning (a)synchronous parallelization on a simple graph problem](https://discourse.julialang.org/t/learning-a-synchronous-parallelization-on-a-simple-graph-problem/92670)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 8\
**Last updated:** [March 5, 2023, 2:09am UTC](https://discourse.julialang.org/t/learning-a-synchronous-parallelization-on-a-simple-graph-problem/92670 "2023-03-05T02:09:58Z")

</div>

I’m starting to learn about concurrent / parallel / distributed computing on a simple graph problem and would really appreciate any help. I am trying to squeeze every drop of performance out of Julia, so comments on how …

---

## [WGLMakie in Pluto firefox overuse of CPU resources](https://discourse.julialang.org/t/wglmakie-in-pluto-firefox-overuse-of-cpu-resources/95494)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 1\
**Last updated:** [March 4, 2023, 9:09am UTC](https://discourse.julialang.org/t/wglmakie-in-pluto-firefox-overuse-of-cpu-resources/95494 "2023-03-04T09:09:15Z")

</div>

I am using WGLMakie to make some interactive plots in Pluto. After making some, my % CPU resources spike like following: starting with no WGLMakie figure and ca. 30% CPU usage 1 figure ca. 150 % CPU usage 2 figure ca…

---

## [LoopVectorization for sparse matrix operation : @turbo, LoopVectorization.check\_args](https://discourse.julialang.org/t/loopvectorization-for-sparse-matrix-operation-turbo-loopvectorization-check-args/95497)

<div class="topic-metadata">

**Author:** [@whn](https://discourse.julialang.org/u/whn)\
**Replies:** 1\
**Last updated:** [March 3, 2023, 1:38pm UTC](https://discourse.julialang.org/t/loopvectorization-for-sparse-matrix-operation-turbo-loopvectorization-check-args/95497 "2023-03-03T13:38:43Z")

</div>

I’m beginning programming in julia. I’m trying to vectorize a loop that generate V, a vector that describes data of a sparse matrix which support indices are defined by Vector{Int64} I and J. u, K, v are contiguous f64 …

---

## [Returs the value of a variable](https://discourse.julialang.org/t/returs-the-value-of-a-variable/95487)

<div class="topic-metadata">

**Author:** [@Amine](https://discourse.julialang.org/u/Amine)\
**Replies:** 1\
**Last updated:** [March 3, 2023, 9:24am UTC](https://discourse.julialang.org/t/returs-the-value-of-a-variable/95487 "2023-03-03T09:24:12Z")

</div>

Hey guys, I am havijg small trouble with my script if you can help, I have a function that calculates angles and i want to use one of these angles “θtT” as an argument of this same function in the second par of my code …

---

## [Julia multithreading is running slower than serial, can someone please explain why...?](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/95430)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 15\
**Last updated:** [March 3, 2023, 8:07am UTC](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/95430 "2023-03-03T08:07:32Z")

</div>

I am trying to parallelize an algorithm which looks like this I initialized a vector of vectors(50000\*1000), in the loop I shifted a random element from an odd-numbered vector into an adjacent even vector at a random pl…

---

## [Fastest Julia startup challenge/smallest sysimage](https://discourse.julialang.org/t/fastest-julia-startup-challenge-smallest-sysimage/95389)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 8\
**Last updated:** [March 3, 2023, 6:34am UTC](https://discourse.julialang.org/t/fastest-julia-startup-challenge-smallest-sysimage/95389 "2023-03-03T06:34:44Z")

</div>

@vchuravy or anyone who would like to help in the challenge. sys.so shrinks from 173M to 96M With julia --startup-file=no startup time improves to 77ms from 127ms on my machine That’s 39% faster startup, with a 44…

---

## [How to parallelize animations](https://discourse.julialang.org/t/how-to-parallelize-animations/95461)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 0\
**Last updated:** [March 2, 2023, 6:23pm UTC](https://discourse.julialang.org/t/how-to-parallelize-animations/95461 "2023-03-02T18:23:40Z")

</div>

I have been using the @animate macro in the Plots.jl package. I have noticed that the animation is always built using one thread. So for example, in the following toy example : N=1000; anim = @animate for t in 1:N …

---

## [Keyword arguments preventing eliding boundscheck](https://discourse.julialang.org/t/keyword-arguments-preventing-eliding-boundscheck/95405)

<div class="topic-metadata">

**Author:** [@OmarElrefaei](https://discourse.julialang.org/u/OmarElrefaei)\
**Replies:** 2\
**Last updated:** [March 1, 2023, 8:59pm UTC](https://discourse.julialang.org/t/keyword-arguments-preventing-eliding-boundscheck/95405 "2023-03-01T20:59:42Z")

</div>

So I’ve got a MWE here with a weird behavior. Note: this seems to be actually fixed in v1.9. But I couldn’t track any relevant issues to PR. I’m trying to elide some checking code with @boundscheck. (yes, the real use …

---

## [SIMD gather result in slow down](https://discourse.julialang.org/t/simd-gather-result-in-slow-down/95161)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 6\
**Last updated:** [February 28, 2023, 7:33pm UTC](https://discourse.julialang.org/t/simd-gather-result-in-slow-down/95161 "2023-02-28T19:33:56Z")

</div>

using SIMD function Unpack(dst::Vector{UInt8}, src::Vector{UInt8}, count::Int) int32SplitArray = src int64Array = reinterpret(Int32, dst) v1 = Int32\[0\] v2 = reinterpret(UInt8, v1) @inbounds for i = 1…

---

## [Ignore\_derivatives of entire module with ChainRules.jl](https://discourse.julialang.org/t/ignore-derivatives-of-entire-module-with-chainrules-jl/95341)

<div class="topic-metadata">

**Author:** [@hshackle](https://discourse.julialang.org/u/hshackle)\
**Replies:** 1\
**Last updated:** [February 28, 2023, 4:06pm UTC](https://discourse.julialang.org/t/ignore-derivatives-of-entire-module-with-chainrules-jl/95341 "2023-02-28T16:06:33Z")

</div>

I’m trying to get reverse differentiation up and running on some simulations. Central to the code is a module that does a lot of array manipulation and bit shifting, which are things that Zygote.jl will complain about. N…

---

## [Building OpenBLAS for PowerPC Defaults to Power8](https://discourse.julialang.org/t/building-openblas-for-powerpc-defaults-to-power8/93972)

<div class="topic-metadata">

**Author:** [@bmgroth](https://discourse.julialang.org/u/bmgroth)\
**Replies:** 10\
**Last updated:** [February 28, 2023, 10:21am UTC](https://discourse.julialang.org/t/building-openblas-for-powerpc-defaults-to-power8/93972 "2023-02-28T10:21:26Z")

</div>

I am trying to get OpenBLAS to compile for Power10. However, it seems OpenBLAS is defaulting to Power8 compilation, which is ~2x slower than the implementation for Power10 as it has MMA support for BLAS 3 routines like …

---

## [Why is my own simplified IO type slower than Base.IOBuffer?](https://discourse.julialang.org/t/why-is-my-own-simplified-io-type-slower-than-base-iobuffer/95308)

<div class="topic-metadata">

**Author:** [@cadaverous](https://discourse.julialang.org/u/cadaverous)\
**Replies:** 1\
**Last updated:** [February 28, 2023, 6:35am UTC](https://discourse.julialang.org/t/why-is-my-own-simplified-io-type-slower-than-base-iobuffer/95308 "2023-02-28T06:35:09Z")

</div>

I am trying to extend Base to include an IO buffer type, similar to DevNull, which just throws away all data written to it, but keeps track of a pointer, in order to find the serialized size of an object. (as suggested i…

---

## [Performance of variants of findall](https://discourse.julialang.org/t/performance-of-variants-of-findall/31659)

<div class="topic-metadata">

**Author:** [@j2b2](https://discourse.julialang.org/u/j2b2)\
**Replies:** 15\
**Last updated:** [February 28, 2023, 6:04am UTC](https://discourse.julialang.org/t/performance-of-variants-of-findall/31659 "2023-02-28T06:04:02Z")

</div>

Here is a small session: julia\> using BenchmarkTools julia\> A = rand(100, 100) 100×100 Array{Float64,2} \[...\] julia\> @btime findall(A .\> 0.5) 39.951 μs (7 allocations: 85.06 KiB) 5077-element Array{CartesianIndex{2…

---

## [Multiplication, sum and Cholesky decomposition of sparse matrices](https://discourse.julialang.org/t/multiplication-sum-and-cholesky-decomposition-of-sparse-matrices/95196)

<div class="topic-metadata">

**Author:** [@andresdrenik](https://discourse.julialang.org/u/andresdrenik)\
**Replies:** 4\
**Last updated:** [February 27, 2023, 8:10pm UTC](https://discourse.julialang.org/t/multiplication-sum-and-cholesky-decomposition-of-sparse-matrices/95196 "2023-02-27T20:10:38Z")

</div>

I’m trying to solve a system of differential equations involving variational inequalities. I’m currently using the LCP solver in LCPsolve.jl. I’ve profiled my code and found that the bottleneck is in lines 216-219 here. …

---

## [Fastest way to convert an MVector/NTuple to a different sized SVector/NTuple?](https://discourse.julialang.org/t/fastest-way-to-convert-an-mvector-ntuple-to-a-different-sized-svector-ntuple/95240)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 8\
**Last updated:** [February 27, 2023, 3:35pm UTC](https://discourse.julialang.org/t/fastest-way-to-convert-an-mvector-ntuple-to-a-different-sized-svector-ntuple/95240 "2023-02-27T15:35:35Z")

</div>

I have tried a number of things to convert an MVector to an SVector and they all result in various numbers of allocations and/or poor performance. My understanding is that an MVector is just a tuple wrapped in a struct. …

---

## [A better git workflow?](https://discourse.julialang.org/t/a-better-git-workflow/95248)

<div class="topic-metadata">

**Author:** [@uje](https://discourse.julialang.org/u/uje)\
**Replies:** 3\
**Last updated:** [February 27, 2023, 10:56am UTC](https://discourse.julialang.org/t/a-better-git-workflow/95248 "2023-02-27T10:56:12Z")

</div>

Having a defined Git workflow is crucial for efficient and organized software development. As a developer working on Julia projects and other open-source projects, not having a defined workflow has been frustrating and h…

---

## [Mysterious runtime difference](https://discourse.julialang.org/t/mysterious-runtime-difference/95234)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 3\
**Last updated:** [February 26, 2023, 9:44pm UTC](https://discourse.julialang.org/t/mysterious-runtime-difference/95234 "2023-02-26T21:44:46Z")

</div>

I would expect the two functions f1(a; dims=:) = reduce(+, a; dims) f2(a, b; dims=:) = b ? reduce(+, a; dims) : reduce(+, a; dims) to have virtually identical runtime, but that is not the case: julia\> a=\[1,2,3\]; julia\>…

---

## [Is it good to include a function in my struct?](https://discourse.julialang.org/t/is-it-good-to-include-a-function-in-my-struct/95129)

<div class="topic-metadata">

**Author:** [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Replies:** 6\
**Last updated:** [February 24, 2023, 8:32pm UTC](https://discourse.julialang.org/t/is-it-good-to-include-a-function-in-my-struct/95129 "2023-02-24T20:32:04Z")

</div>

I have a struct which has a field referring to a function, which is used as following. struct myT f::Function end function Base.getindex(foo::myT, i)::Float64 foo.f(...) end I noticed that code\_warntype shows │ …

---

## [Storing huge amount of data efficiently](https://discourse.julialang.org/t/storing-huge-amount-of-data-efficiently/94818)

<div class="topic-metadata">

**Author:** [@Dario-Rosa85](https://discourse.julialang.org/u/Dario-Rosa85)\
**Replies:** 15\
**Last updated:** [February 24, 2023, 9:21am UTC](https://discourse.julialang.org/t/storing-huge-amount-of-data-efficiently/94818 "2023-02-24T09:21:37Z")

</div>

Hello, I am performing some numerical computations and I have the necessity to run a huge (say, several thousand of iterations) for loop. Each iteration produces a certain amount of data that I need to store in the disk…

---

## [Fastest way to do memoization?](https://discourse.julialang.org/t/fastest-way-to-do-memoization/95100)

<div class="topic-metadata">

**Author:** [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Replies:** 11\
**Last updated:** [February 23, 2023, 9:18pm UTC](https://discourse.julialang.org/t/fastest-way-to-do-memoization/95100 "2023-02-23T21:18:23Z")

</div>

I have a two-argument function, for which I want to cache the results. Currently I use a Dict to store the previous results. The performance is OK, but profiling said that a lot of time is taken by finding the index. …

---

## [Pola.rs vs DataFrames.jl](https://discourse.julialang.org/t/pola-rs-vs-dataframes-jl/95090)

<div class="topic-metadata">

**Author:** [@klwlevy](https://discourse.julialang.org/u/klwlevy)\
**Replies:** 8\
**Last updated:** [February 23, 2023, 6:36pm UTC](https://discourse.julialang.org/t/pola-rs-vs-dataframes-jl/95090 "2023-02-23T18:36:49Z")

</div>

There seems to be quite some activity in the Python community about using pola.rs to get fast dataframes, with the aid of Rust. As a frequent DataFrames.jl user, I would be curious to hear @bkamins opinion on this “compe…

---

## [Best method for (scalar) second derivative with ForwardDiff](https://discourse.julialang.org/t/best-method-for-scalar-second-derivative-with-forwarddiff/95039)

<div class="topic-metadata">

**Author:** [@fph](https://discourse.julialang.org/u/fph)\
**Replies:** 4\
**Last updated:** [February 23, 2023, 5:04pm UTC](https://discourse.julialang.org/t/best-method-for-scalar-second-derivative-with-forwarddiff/95039 "2023-02-23T17:04:23Z")

</div>

What is the best/most efficient method to find the first two derivatives of a scalar function with ForwardDiff? This old post suggests ForwardDiff.derivative(x -\> ForwardDiff.derivative(f, x), 1.0) to compute the seco…

---

## [Keyword Arguments and Type Stability](https://discourse.julialang.org/t/keyword-arguments-and-type-stability/94993)

<div class="topic-metadata">

**Author:** [@alfaromartino](https://discourse.julialang.org/u/alfaromartino)\
**Replies:** 11\
**Last updated:** [February 23, 2023, 9:23am UTC](https://discourse.julialang.org/t/keyword-arguments-and-type-stability/94993 "2023-02-23T09:23:44Z")

</div>

I need to remain flexible (I’m testing the code) and I ran into the following problem. MWE param = 2 x = rand(100) foo(x; β = param) = sum(x .\* β) @code\_warntype foo(x) # type unstable @code\_warntype fo…

---

## [String Handling Functions](https://discourse.julialang.org/t/string-handling-functions/95058)

<div class="topic-metadata">

**Author:** [@smashcoder2003](https://discourse.julialang.org/u/smashcoder2003)\
**Replies:** 7\
**Last updated:** [February 23, 2023, 4:52am UTC](https://discourse.julialang.org/t/string-handling-functions/95058 "2023-02-23T04:52:01Z")

</div>

Is there a package or module for string handling functions? Did anyone write a package or module for string handling?

---

## [\--track-allocation changes allocation behavior of code?](https://discourse.julialang.org/t/track-allocation-changes-allocation-behavior-of-code/95044)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 1\
**Last updated:** [February 22, 2023, 9:40pm UTC](https://discourse.julialang.org/t/track-allocation-changes-allocation-behavior-of-code/95044 "2023-02-22T21:40:32Z")

</div>

I made some code changes which I guessed would improve memory usage. @time shows a huge speedup, \> 10x, and a \>98% reduction in memory used. But when I use --track-allocation it seems as if my changes made things much w…

---

## [Pkg within compiled app \[PackageCompiler\]](https://discourse.julialang.org/t/pkg-within-compiled-app-packagecompiler/94963)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 2\
**Last updated:** [February 21, 2023, 8:07pm UTC](https://discourse.julialang.org/t/pkg-within-compiled-app-packagecompiler/94963 "2023-02-21T20:07:30Z")

</div>

Hi, I am experimenting with PackageCompiler.jl and was surprised that the app I build (using incremental=true) does not include Pkg itself. Does someone whether this is intended and if so, whether it is possible to por…

---

## [Reverse-Mode AD VJP choices all failed](https://discourse.julialang.org/t/reverse-mode-ad-vjp-choices-all-failed/94929)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [February 20, 2023, 7:03pm UTC](https://discourse.julialang.org/t/reverse-mode-ad-vjp-choices-all-failed/94929 "2023-02-20T19:03:58Z")

</div>

Hi, I am running a neural network with Flux, Zygote, and Optimization libraries. The code is rather long and I have not created a MWE yet (which could take quite a while). The code ran about 800 iterations without troub…

---

## [Would it be interesting to optimize print(io, xs...) to be type stable?](https://discourse.julialang.org/t/would-it-be-interesting-to-optimize-print-io-xs-to-be-type-stable/94816)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 2\
**Last updated:** [February 20, 2023, 4:22pm UTC](https://discourse.julialang.org/t/would-it-be-interesting-to-optimize-print-io-xs-to-be-type-stable/94816 "2023-02-20T16:22:02Z")

</div>

I noticed that the varargs version of print/println is not type stable and it affects the performance. Some test code below. It’s interesting that map, foreach, and fold are implemented in a type stable way, so… println …

---

## [Arpack is broken?](https://discourse.julialang.org/t/arpack-is-broken/94758)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 3\
**Last updated:** [February 19, 2023, 7:29pm UTC](https://discourse.julialang.org/t/arpack-is-broken/94758 "2023-02-19T19:29:35Z")

</div>

Hi all. sorry to bother you guys. I wrote a code a couple of years back that used Arpack in julia. I am updating it but I can´t run it. In my notes for it I have this: Arpacy\_jll must be the newer version. The older …

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

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