# Performance

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

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

**Page:** 106

---

## [Effect of Column Major Storage on Multiplication](https://discourse.julialang.org/t/effect-of-column-major-storage-on-multiplication/49722)

<div class="topic-metadata">

**Author:** [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Replies:** 3\
**Last updated:** [November 7, 2020, 8:19pm UTC](https://discourse.julialang.org/t/effect-of-column-major-storage-on-multiplication/49722 "2020-11-07T20:19:43Z")

</div>

Hello, I am multiplying a square matrix with a vector. I thought A '\* x would be faster than A \* x as the former is inner-product of x with columns of A, which are stored contiguously in Julia. As opposed to the latter …

---

## [Memory efficient melting and stacking? Reshaping Wide to Long](https://discourse.julialang.org/t/memory-efficient-melting-and-stacking-reshaping-wide-to-long/49657)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 11\
**Last updated:** [November 7, 2020, 1:32am UTC](https://discourse.julialang.org/t/memory-efficient-melting-and-stacking-reshaping-wide-to-long/49657 "2020-11-07T01:32:37Z")

</div>

I need to reshape large dataframes from Wide to Long format. The input looks like this, with a unique ID per row, and multiple columns with a date in the name and multiple columns without the date. # R code my \<- data.…

---

## [Worse performance of LU-decomposition for Float32 than for Float64](https://discourse.julialang.org/t/worse-performance-of-lu-decomposition-for-float32-than-for-float64/49631)

<div class="topic-metadata">

**Author:** [@DavidBerghaus](https://discourse.julialang.org/u/DavidBerghaus)\
**Replies:** 7\
**Last updated:** [November 5, 2020, 5:26pm UTC](https://discourse.julialang.org/t/worse-performance-of-lu-decomposition-for-float32-than-for-float64/49631 "2020-11-05T17:26:05Z")

</div>

For some applications one might gain performance by using 32-bit arithmetic on a 64-bit system because this could improve memory-bandwidth as well as (possible) SIMD operations. I noticed however that some functions see…

---

## [Threads.@threads gives unexpected results](https://discourse.julialang.org/t/threads-threads-gives-unexpected-results/49628)

<div class="topic-metadata">

**Author:** [@O\_Julia](https://discourse.julialang.org/u/O_Julia)\
**Replies:** 3\
**Last updated:** [November 5, 2020, 4:20pm UTC](https://discourse.julialang.org/t/threads-threads-gives-unexpected-results/49628 "2020-11-05T16:20:47Z")

</div>

Hi, I am trying to optimize a simple function. I have written both devectorized and vectorized version codes for the function to see which one is faster. Here are the codes: Vectorized: function funvec(m::Int64,data::A…

---

## [Broadcast with \>3 parameters 30x slower](https://discourse.julialang.org/t/broadcast-with-3-parameters-30x-slower/49614)

<div class="topic-metadata">

**Author:** [@Yamen](https://discourse.julialang.org/u/Yamen)\
**Replies:** 6\
**Last updated:** [November 5, 2020, 12:38pm UTC](https://discourse.julialang.org/t/broadcast-with-3-parameters-30x-slower/49614 "2020-11-05T12:38:09Z")

</div>

Trying to understand this behaviour, once we go to 4+ entries it slows down dramatically. Understand I may need to add the specialisations for 4+ myself, but not sure where to start… a = rand(Bool, 100\_000) b = rand(Boo…

---

## [Inverse of a triangular matrix](https://discourse.julialang.org/t/inverse-of-a-triangular-matrix/49620)

<div class="topic-metadata">

**Author:** [@stla](https://discourse.julialang.org/u/stla)\
**Replies:** 2\
**Last updated:** [November 5, 2020, 11:11am UTC](https://discourse.julialang.org/t/inverse-of-a-triangular-matrix/49620 "2020-11-05T11:11:46Z")

</div>

Hello, Is there an optimized way to inverse a triangular matrix? I searched with Google, no luck.

---

## [Linear solve in mixed precision koan](https://discourse.julialang.org/t/linear-solve-in-mixed-precision-koan/49594)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 4\
**Last updated:** [November 5, 2020, 12:50am UTC](https://discourse.julialang.org/t/linear-solve-in-mixed-precision-koan/49594 "2020-11-05T00:50:22Z")

</div>

I want to store a matrix in Float32 and do several solves with a Float64 right hand sides. In LINPACK, (and I think LAPACK) this just works. In Matlab (see below) it’s less clear. However in something bizarre happens wi…

---

## [Rand(10^8) runs ok, (10^9)...crashes and auto-restart Julia](https://discourse.julialang.org/t/rand-10-8-runs-ok-10-9-crashes-and-auto-restart-julia/49598)

<div class="topic-metadata">

**Author:** [@teriiju](https://discourse.julialang.org/u/teriiju)\
**Replies:** 9\
**Last updated:** [November 4, 2020, 9:57pm UTC](https://discourse.julialang.org/t/rand-10-8-runs-ok-10-9-crashes-and-auto-restart-julia/49598 "2020-11-04T21:57:34Z")

</div>

Running… rand(10^9) will lead my jupyter notebook session to crash and autorestart on my PC. Q : Is this a limit to be expected using Rand on a I3 - single thread - or are there workaround to push the rand() function…

---

## [BFGS very slow compared to BlackBoxOptim - How to improve performance](https://discourse.julialang.org/t/bfgs-very-slow-compared-to-blackboxoptim-how-to-improve-performance/49253)

<div class="topic-metadata">

**Author:** [@vsskanth](https://discourse.julialang.org/u/vsskanth)\
**Replies:** 20\
**Last updated:** [November 3, 2020, 3:58pm UTC](https://discourse.julialang.org/t/bfgs-very-slow-compared-to-blackboxoptim-how-to-improve-performance/49253 "2020-11-03T15:58:25Z")

</div>

I am trying to fit a differential equation (using DiffEqParamEstim) with these properties: Lumped parameter linear thermal model with 3 states 8 interpolated external inputs (sampled at 50 Hz) using Interpolations.jl o…

---

## [SVector vs struct performance](https://discourse.julialang.org/t/svector-vs-struct-performance/49503)

<div class="topic-metadata">

**Author:** [@arnief3](https://discourse.julialang.org/u/arnief3)\
**Replies:** 8\
**Last updated:** [November 3, 2020, 10:46am UTC](https://discourse.julialang.org/t/svector-vs-struct-performance/49503 "2020-11-03T10:46:14Z")

</div>

I am struggling to understand the huge performance difference I am seeing between these two approaches to creating a Vec3 DataType. I would prefer to use a SVector, but only if the performance is comparable. I feel like …

---

## [Multithreading of a simple loop](https://discourse.julialang.org/t/multithreading-of-a-simple-loop/49478)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 6\
**Last updated:** [November 3, 2020, 1:07am UTC](https://discourse.julialang.org/t/multithreading-of-a-simple-loop/49478 "2020-11-03T01:07:58Z")

</div>

Hi, I am trying to use multi-threading to parallelise a simple loop. The actual code is quite complex and I have given a simplified example. The multithreaded version runs slower than the single thread version. I have …

---

## [Solving same DiffEq repeatedly but with different initial conditions](https://discourse.julialang.org/t/solving-same-diffeq-repeatedly-but-with-different-initial-conditions/49402)

<div class="topic-metadata">

**Author:** [@ash](https://discourse.julialang.org/u/ash)\
**Replies:** 2\
**Last updated:** [November 2, 2020, 8:14pm UTC](https://discourse.julialang.org/t/solving-same-diffeq-repeatedly-but-with-different-initial-conditions/49402 "2020-11-02T20:14:46Z")

</div>

I have a set of coupled ODEs that I’d like to solve, which is simple enough using DifferentialEquations.jl. My problem is that I need to solve the same ODE repeatedly for many different initial conditions parametrized by…

---

## [When Julia gets within 1-3x of C/C++ speed, why is C/C++ usually faster?](https://discourse.julialang.org/t/when-julia-gets-within-1-3x-of-c-c-speed-why-is-c-c-usually-faster/49341)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 11\
**Last updated:** [November 2, 2020, 4:58am UTC](https://discourse.julialang.org/t/when-julia-gets-within-1-3x-of-c-c-speed-why-is-c-c-usually-faster/49341 "2020-11-02T04:58:47Z")

</div>

A notion that I’m getting from blogs and published papers comparing Julia with other languages in practical use cases is that Julia gets within 1-3x of the speed of the fastest implementation in C/C++ (though it’s worth …

---

## [BitVector vs Vector{Bool} as default on comparison operations](https://discourse.julialang.org/t/bitvector-vs-vector-bool-as-default-on-comparison-operations/49431)

<div class="topic-metadata">

**Author:** [@Yamen](https://discourse.julialang.org/u/Yamen)\
**Replies:** 8\
**Last updated:** [November 2, 2020, 2:30am UTC](https://discourse.julialang.org/t/bitvector-vs-vector-bool-as-default-on-comparison-operations/49431 "2020-11-02T02:30:10Z")

</div>

Comparison operations on numeric Vectors return BitVectors by default: const a = rand(100\_000) const b = rand(100\_000) test1(a, b) = a .\> b julia\> @btime test1($a,$b) 24.901 μs (3 allocations: 16.59 KiB) 100000-elem…

---

## [Loop faster than \`reduce\`?](https://discourse.julialang.org/t/loop-faster-than-reduce/48927)

<div class="topic-metadata">

**Author:** [@stla](https://discourse.julialang.org/u/stla)\
**Replies:** 7\
**Last updated:** [October 31, 2020, 9:12pm UTC](https://discourse.julialang.org/t/loop-faster-than-reduce/48927 "2020-10-31T21:12:56Z")

</div>

Hello, Is there a way to do better than such a loop: for t in 2:n jarray = jack(t, jarray) end I tried jarray = reduce((a, t) -\> jack(t, a), 2:n; init = jarray), but this is slower than the loop.

---

## [Unexpected Tullio behavior](https://discourse.julialang.org/t/unexpected-tullio-behavior/49371)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 6\
**Last updated:** [October 31, 2020, 5:17pm UTC](https://discourse.julialang.org/t/unexpected-tullio-behavior/49371 "2020-10-31T17:17:35Z")

</div>

In the program below, I had expected a, a2 to produce the same result, but they don’t. It appears that Tullio (which I like!) does not deal with vectors of matrices in the way that I had expected. The output is: \[ Inf…

---

## [Minimizing allocations from memoized functions](https://discourse.julialang.org/t/minimizing-allocations-from-memoized-functions/49221)

<div class="topic-metadata">

**Author:** [@ash](https://discourse.julialang.org/u/ash)\
**Replies:** 10\
**Last updated:** [October 31, 2020, 7:05am UTC](https://discourse.julialang.org/t/minimizing-allocations-from-memoized-functions/49221 "2020-10-31T07:05:17Z")

</div>

I have the following MWE using a memoized function: using Memoization using FFTW struct Operators{F} K::F # More operators end function run(N, α) M = 512 ω = rand(M) # Cache the kinetic factor …

---

## [Simple benchmarks to run to test WSL2 vs Windows Native](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 8\
**Last updated:** [October 30, 2020, 12:43am UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343 "2020-10-30T00:43:01Z")

</div>

I just upgraded to the new Windows May update which now has WSL 2 (a very lightweight, Hyper V VM running full Linux). I essentially now want to move all my development over to Linux. But I would like to test if there ar…

---

## [Very slow execution time in comparison even to Python](https://discourse.julialang.org/t/very-slow-execution-time-in-comparison-even-to-python/49223)

<div class="topic-metadata">

**Author:** [@Yury\_Kotlyarov](https://discourse.julialang.org/u/Yury_Kotlyarov)\
**Replies:** 35\
**Last updated:** [October 29, 2020, 9:38pm UTC](https://discourse.julialang.org/t/very-slow-execution-time-in-comparison-even-to-python/49223 "2020-10-29T21:38:53Z")

</div>

I am new to Julia. While choosing a programming language for our next project wrote a short program in Julia: using LinearAlgebra using Statistics using Random import Base: +, - struct Point x::Float64 y::Flo…

---

## [Multiple dispatch with more than 4 methods blocks type inference](https://discourse.julialang.org/t/multiple-dispatch-with-more-than-4-methods-blocks-type-inference/49066)

<div class="topic-metadata">

**Author:** [@schaerfo](https://discourse.julialang.org/u/schaerfo)\
**Replies:** 15\
**Last updated:** [October 28, 2020, 9:29pm UTC](https://discourse.julialang.org/t/multiple-dispatch-with-more-than-4-methods-blocks-type-inference/49066 "2020-10-28T21:29:40Z")

</div>

Consider the following code: using InteractiveUtils struct A end struct B end g(r::A, s::A, t::A, u::A) = 1 g(r::B, s::A, t::A, u::A) = 2 g(r::B, s::A, t::B, u::A) = 3 g(r::B, s::B, t::A, u::A) = 4 g(r::B, s::B, t::B,…

---

## [Accelerating the calculation of minimum distance between points, annotating which is the point](https://discourse.julialang.org/t/accelerating-the-calculation-of-minimum-distance-between-points-annotating-which-is-the-point/49200)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 9\
**Last updated:** [October 28, 2020, 8:38pm UTC](https://discourse.julialang.org/t/accelerating-the-calculation-of-minimum-distance-between-points-annotating-which-is-the-point/49200 "2020-10-28T20:38:53Z")

</div>

I am writing a package that needs to compute the minimum distance between sets of coordinates in space of atoms (ComplexMixtures). I am already using cell lists, but at the very end the one finishes with the problem of c…

---

## [Idiomatic storage for intermediate calculations](https://discourse.julialang.org/t/idiomatic-storage-for-intermediate-calculations/49138)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 8\
**Last updated:** [October 28, 2020, 5:20pm UTC](https://discourse.julialang.org/t/idiomatic-storage-for-intermediate-calculations/49138 "2020-10-28T17:20:30Z")

</div>

I’m writing a module that’s numerically intensive (aren’t we all?), and I’m running into an issue where I seem to be fighting the language… which makes me suspect I’m doing it wrong. Specifically, I want to have a struc…

---

## [Parallel/multithreading version of linear regression](https://discourse.julialang.org/t/parallel-multithreading-version-of-linear-regression/48771)

<div class="topic-metadata">

**Author:** [@Antonina\_Klyuyeva](https://discourse.julialang.org/u/Antonina_Klyuyeva)\
**Replies:** 19\
**Last updated:** [October 28, 2020, 1:28am UTC](https://discourse.julialang.org/t/parallel-multithreading-version-of-linear-regression/48771 "2020-10-28T01:28:09Z")

</div>

Hi there, I’m new to Julia. I implemented regression model with interactions using Julia GLM package: Reg = lm(@formula(dep\_var ~ var1&var2&var3), data, true). But fitting this formula requires a lot of RAM (\> 80 GB)…

---

## [Loading Reduce.jl into Weave is going really slow](https://discourse.julialang.org/t/loading-reduce-jl-into-weave-is-going-really-slow/49080)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 5\
**Last updated:** [October 27, 2020, 7:00pm UTC](https://discourse.julialang.org/t/loading-reduce-jl-into-weave-is-going-really-slow/49080 "2020-10-27T19:00:21Z")

</div>

when I have a using Reduce and I try to weave it, it weaves really slow. I want to use reduce, for things like expanding, but it won’t load. what all affects the speed and ability of packages to load into Julia Markdow…

---

## [JuliaAudio-LibsndFile Help needed](https://discourse.julialang.org/t/juliaaudio-libsndfile-help-needed/48613)

<div class="topic-metadata">

**Author:** [@Ashwani\_Rathee](https://discourse.julialang.org/u/Ashwani_Rathee)\
**Replies:** 2\
**Last updated:** [October 27, 2020, 12:12pm UTC](https://discourse.julialang.org/t/juliaaudio-libsndfile-help-needed/48613 "2020-10-27T12:12:28Z")

</div>

Hey guys,I am exploring the audio library LibSndFile.jl and WAV.jl and when writing a julia script,I wanted the info printed after load(filename) as a string(can be done by redirect stdout i think)…or better if I can …

---

## [Image IO and processing efficiency: sequential versus bulk](https://discourse.julialang.org/t/image-io-and-processing-efficiency-sequential-versus-bulk/48975)

<div class="topic-metadata">

**Author:** [@jakewilliami](https://discourse.julialang.org/u/jakewilliami)\
**Replies:** 9\
**Last updated:** [October 27, 2020, 1:25am UTC](https://discourse.julialang.org/t/image-io-and-processing-efficiency-sequential-versus-bulk/48975 "2020-10-27T01:25:31Z")

</div>

I have an algorithm that loads and processes images. There are two ways of doing this: Load all images together, and process them all together (bulk); or One-by-one, load and process the images (sequential). I have c…

---

## [Very slow Plots performance and... no plot](https://discourse.julialang.org/t/very-slow-plots-performance-and-no-plot/49064)

<div class="topic-metadata">

**Author:** [@rnturn](https://discourse.julialang.org/u/rnturn)\
**Replies:** 8\
**Last updated:** [October 26, 2020, 9:44pm UTC](https://discourse.julialang.org/t/very-slow-plots-performance-and-no-plot/49064 "2020-10-26T21:44:53Z")

</div>

Environment: openSUSE 15.1, downloaded Julia 1.5.2 (tar.gz). I’m finding that using Plots (pun sort of intended) is really slow and when I use plot() in a script I get no output: #plottest using Dates t0 = now() using …

---

## [Https://www.anaconda.com blocked](https://discourse.julialang.org/t/https-www-anaconda-com-blocked/48969)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 1\
**Last updated:** [October 25, 2020, 2:22pm UTC](https://discourse.julialang.org/t/https-www-anaconda-com-blocked/48969 "2020-10-25T14:22:48Z")

</div>

My current network has https://www.anaconda.com blocked. But I have managed to download, from main/win-64, the file matplotlib-base-3.3.2-py38hba9282a\_0.tar.bz2 Is there any way to activate it, from Julia, using the C…

---

## [Update Conda vs update Julia 1.5.2](https://discourse.julialang.org/t/update-conda-vs-update-julia-1-5-2/48926)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 2\
**Last updated:** [October 25, 2020, 6:38am UTC](https://discourse.julialang.org/t/update-conda-vs-update-julia-1-5-2/48926 "2020-10-25T06:38:47Z")

</div>

After successfully performing the Coda update: using Conda \[ Info: Precompiling Conda \[8f4d0f93-b110-5947-807f-2305c1781a2d\] julia\> Conda.ROOTENV "C:\\\\Users\\\\user\\\\.julia\\\\conda\\\\3" julia\> Conda.update() \[ Info: Runni…

---

## [Improving perfomance on nested loops](https://discourse.julialang.org/t/improving-perfomance-on-nested-loops/48864)

<div class="topic-metadata">

**Author:** [@k945](https://discourse.julialang.org/u/k945)\
**Replies:** 5\
**Last updated:** [October 25, 2020, 5:29am UTC](https://discourse.julialang.org/t/improving-perfomance-on-nested-loops/48864 "2020-10-25T05:29:00Z")

</div>

I am trying to improve the performance of script that I am converting from python. To my knowledge, I have: written a kernel function, preallocated my output and accessed memory in order. While I have improved the scrip…

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

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