# Performance

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

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

**Page:** 121

---

## [Serious slowdown with FFTW v1.1.0 and v1.2.0 on Windows](https://discourse.julialang.org/t/serious-slowdown-with-fftw-v1-1-0-and-v1-2-0-on-windows/34726)

<div class="topic-metadata">

**Author:** [@turtle](https://discourse.julialang.org/u/turtle)\
**Replies:** 21\
**Last updated:** [February 21, 2020, 2:22pm UTC](https://discourse.julialang.org/t/serious-slowdown-with-fftw-v1-1-0-and-v1-2-0-on-windows/34726 "2020-02-21T14:22:38Z")

</div>

I have just upgraded from Julia 0.7.0 → 1.0.5 and 1.3.1, and experienced a serious slowdown. It seems to me that the reason is the default FFTW version that is: FFTW v0.2.4 for Julia 0.7.0 FFTW v1.1.0 for Julia 1.0.5 …

---

## [Multi-thread parsing json](https://discourse.julialang.org/t/multi-thread-parsing-json/33389)

<div class="topic-metadata">

**Author:** [@racinmat](https://discourse.julialang.org/u/racinmat)\
**Replies:** 16\
**Last updated:** [February 21, 2020, 2:07pm UTC](https://discourse.julialang.org/t/multi-thread-parsing-json/33389 "2020-02-21T14:07:31Z")

</div>

Hi, I am loading lots of gzipped jsons, parsing and further processing them. TL;DR: Why is map much slower than list comprehension/dot notation when using in tmap on multiple threads? I am trying to use multiple thread…

---

## [Future.randjump peculiar speed](https://discourse.julialang.org/t/future-randjump-peculiar-speed/34862)

<div class="topic-metadata">

**Author:** [@stephenll](https://discourse.julialang.org/u/stephenll)\
**Replies:** 1\
**Last updated:** [February 21, 2020, 3:05am UTC](https://discourse.julialang.org/t/future-randjump-peculiar-speed/34862 "2020-02-21T03:05:07Z")

</div>

At my company we typically break up the simulations into predefined fixed “chunks”, and assign a seed to each chunk this way the dynamic scheduler in the threading is repeatable no matter the number of threads. I have b…

---

## [What is wrong with my profiling?](https://discourse.julialang.org/t/what-is-wrong-with-my-profiling/34898)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 4\
**Last updated:** [February 20, 2020, 3:26pm UTC](https://discourse.julialang.org/t/what-is-wrong-with-my-profiling/34898 "2020-02-20T15:26:36Z")

</div>

I am profiling my Deep Learning algorithm and I am getting this weird shape. That long line on the left does not make sense, is it precompiling or something ? The name of the top bar is task.jl,poptaskref: line 660. Mayb…

---

## [Perf improvement suggestion for simple extrema](https://discourse.julialang.org/t/perf-improvement-suggestion-for-simple-extrema/34776)

<div class="topic-metadata">

**Author:** [@wizebt](https://discourse.julialang.org/u/wizebt)\
**Replies:** 4\
**Last updated:** [February 18, 2020, 2:30pm UTC](https://discourse.julialang.org/t/perf-improvement-suggestion-for-simple-extrema/34776 "2020-02-18T14:30:28Z")

</div>

While working on large arrays (images) searching for the fastest min/max and extrema I struggled to findout that recent fast minimum and maximum implementation use reduce. However extrema can be improved julia\> versioni…

---

## [@inbounds macro on sparse arrays](https://discourse.julialang.org/t/inbounds-macro-on-sparse-arrays/34810)

<div class="topic-metadata">

**Author:** [@mlanghinrichs](https://discourse.julialang.org/u/mlanghinrichs)\
**Replies:** 2\
**Last updated:** [February 18, 2020, 2:19pm UTC](https://discourse.julialang.org/t/inbounds-macro-on-sparse-arrays/34810 "2020-02-18T14:19:21Z")

</div>

Hi all, the @inbounds macro can speed up the in-place editing of a standard array by a factor of two; however it has no performance gain for the same task when applied on a sparse matrix. Please see my test functions an…

---

## [Profiling module precompilation](https://discourse.julialang.org/t/profiling-module-precompilation/33438)

<div class="topic-metadata">

**Author:** [@theogf](https://discourse.julialang.org/u/theogf)\
**Replies:** 6\
**Last updated:** [February 18, 2020, 1:30pm UTC](https://discourse.julialang.org/t/profiling-module-precompilation/33438 "2020-02-18T13:30:20Z")

</div>

Hi! My package (AugmentedGaussianProcesses.jl) always take forever to precompile when I make modifications. I would like to see where the bottlenecks are to eventually optimize or remove problematic stuff. Is there any…

---

## [Force specialization on varargs when the arguments are not all of the same concrete type](https://discourse.julialang.org/t/force-specialization-on-varargs-when-the-arguments-are-not-all-of-the-same-concrete-type/34788)

<div class="topic-metadata">

**Author:** [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Replies:** 5\
**Last updated:** [February 18, 2020, 7:23am UTC](https://discourse.julialang.org/t/force-specialization-on-varargs-when-the-arguments-are-not-all-of-the-same-concrete-type/34788 "2020-02-18T07:23:32Z")

</div>

The manual page on Performance Tips (https://github.com/JuliaLang/julia/blob/master/doc/src/manual/performance-tips.md) says: This will not specialize: f\_vararg(x::Int...) = tuple(x...) but this will: g\_vararg(x::Va…

---

## [Looping over rows and columns: what am I doing wrong?](https://discourse.julialang.org/t/looping-over-rows-and-columns-what-am-i-doing-wrong/34761)

<div class="topic-metadata">

**Author:** [@edwinb-ai](https://discourse.julialang.org/u/edwinb-ai)\
**Replies:** 4\
**Last updated:** [February 17, 2020, 8:42pm UTC](https://discourse.julialang.org/t/looping-over-rows-and-columns-what-am-i-doing-wrong/34761 "2020-02-17T20:42:08Z")

</div>

Following some of the Performance Tips in the main Julia documentation I was a trying the following code, timing it with BenchmarkTools.jl: using Random using BenchmarkTools b = rand(3, 100) function loop\_rows(a::Abst…

---

## [Int numerical calculation speed slower than Float?](https://discourse.julialang.org/t/int-numerical-calculation-speed-slower-than-float/34705)

<div class="topic-metadata">

**Author:** [@nuclear718](https://discourse.julialang.org/u/nuclear718)\
**Replies:** 12\
**Last updated:** [February 17, 2020, 10:10am UTC](https://discourse.julialang.org/t/int-numerical-calculation-speed-slower-than-float/34705 "2020-02-17T10:10:24Z")

</div>

Why the calculation speed of “Int” matrix is much slower than “Float” matrix? IDE: Jupyter Julia version: 1.1.0 Code for Float: s=1000 d1=rand(s,s) d2=rand(s,s) @time (d1\*d2); Result: 0.032192 seconds (6 allocati…

---

## [Optimization tips for my julia code. Can I make it even faster and/or memory efficient?](https://discourse.julialang.org/t/optimization-tips-for-my-julia-code-can-i-make-it-even-faster-and-or-memory-efficient/34614)

<div class="topic-metadata">

**Author:** [@PyDataBlog](https://discourse.julialang.org/u/PyDataBlog)\
**Replies:** 24\
**Last updated:** [February 15, 2020, 2:22pm UTC](https://discourse.julialang.org/t/optimization-tips-for-my-julia-code-can-i-make-it-even-faster-and-or-memory-efficient/34614 "2020-02-15T14:22:49Z")

</div>

Hi everyone, I have been learning Julia since January by trying to implement classic machine learning algorithms from scratch. My latest project is the KMeans clustering algorithm. I have been successful with this imple…

---

## [Fast alternative to mutable struct](https://discourse.julialang.org/t/fast-alternative-to-mutable-struct/34593)

<div class="topic-metadata">

**Author:** [@kaltsoplyn](https://discourse.julialang.org/u/kaltsoplyn)\
**Replies:** 10\
**Last updated:** [February 13, 2020, 10:02pm UTC](https://discourse.julialang.org/t/fast-alternative-to-mutable-struct/34593 "2020-02-13T22:02:50Z")

</div>

Hi, first discourse topic/question ever, please do tell if this is the wrong place for this type of question. (I’m also new to Julia, so this might be trivial.) I have a function, with a couple of keyword arguments. (D…

---

## [How to solve error while running parallel sampling in Julia with Turing and Distributed package?](https://discourse.julialang.org/t/how-to-solve-error-while-running-parallel-sampling-in-julia-with-turing-and-distributed-package/34551)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 5\
**Last updated:** [February 13, 2020, 4:42am UTC](https://discourse.julialang.org/t/how-to-solve-error-while-running-parallel-sampling-in-julia-with-turing-and-distributed-package/34551 "2020-02-13T04:42:08Z")

</div>

Hi, I am trying to run samplers in parallel by using example code in Turing documentation (Parallel Sampling). When I run the following example, I am getting an error. The example is as follows: using Distributed addpr…

---

## [JuMP vs SAS](https://discourse.julialang.org/t/jump-vs-sas/34520)

<div class="topic-metadata">

**Author:** [@Dominic\_Pazzula](https://discourse.julialang.org/u/Dominic_Pazzula)\
**Replies:** 10\
**Last updated:** [February 12, 2020, 9:58pm UTC](https://discourse.julialang.org/t/jump-vs-sas/34520 "2020-02-12T21:58:15Z")

</div>

New to Julia, so I apologize if this is simple… I am evaluating new technologies to potentially replace SAS for some decision support tools. One in particular is a non-linear optimization of decent (but not huge) size.…

---

## [On the Computational Efficiency of SparseArrays](https://discourse.julialang.org/t/on-the-computational-efficiency-of-sparsearrays/34531)

<div class="topic-metadata">

**Author:** [@asavasci](https://discourse.julialang.org/u/asavasci)\
**Replies:** 4\
**Last updated:** [February 12, 2020, 7:27pm UTC](https://discourse.julialang.org/t/on-the-computational-efficiency-of-sparsearrays/34531 "2020-02-12T19:27:16Z")

</div>

I am getting much more averaged computation time by using sparse matrices structure. Is there something wrong on my code? I used a quick test script to test multiplication of both data structure. using SparseArrays, Sta…

---

## [Are fields with structtypes to be avoided as well?](https://discourse.julialang.org/t/are-fields-with-structtypes-to-be-avoided-as-well/34515)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [February 12, 2020, 3:11pm UTC](https://discourse.julialang.org/t/are-fields-with-structtypes-to-be-avoided-as-well/34515 "2020-02-12T15:11:01Z")

</div>

In the manual it is recommended to avoid abstract type fields: Performance Tips · The Julia Language. It is not precised if this is also the case for struct type. Example: julia\> struct Foo{T} x::T end julia\> isabstrac…

---

## [Optimize performance comparison - Optim.jl vs Scipy](https://discourse.julialang.org/t/optimize-performance-comparison-optim-jl-vs-scipy/12588)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 15\
**Last updated:** [February 12, 2020, 5:10am UTC](https://discourse.julialang.org/t/optimize-performance-comparison-optim-jl-vs-scipy/12588 "2020-02-12T05:10:15Z")

</div>

I am just starting to learn about optimization. I picked up Optim.jl (great documentation, btw) and tried to do the same thing in Python. It seems that Rosenbrock function is what everyone uses as an example. Perhaps …

---

## [Does inlining work when the function is passed as an argument?](https://discourse.julialang.org/t/does-inlining-work-when-the-function-is-passed-as-an-argument/34470)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [February 11, 2020, 3:55pm UTC](https://discourse.julialang.org/t/does-inlining-work-when-the-function-is-passed-as-an-argument/34470 "2020-02-11T15:55:40Z")

</div>

Just wondering. For example @inline function foo(x,y) @assert length(x) == length(y) x .+ y.\*rand(length(y)) end function apply\_function(x,y,f) f(x,y) end julia\> apply\_function(rand(10), rand(10), foo)

---

## [OutOfMemoryError() while solving a linear system](https://discourse.julialang.org/t/outofmemoryerror-while-solving-a-linear-system/33921)

<div class="topic-metadata">

**Author:** [@AhmedAlreweny](https://discourse.julialang.org/u/AhmedAlreweny)\
**Replies:** 10\
**Last updated:** [February 10, 2020, 3:59pm UTC](https://discourse.julialang.org/t/outofmemoryerror-while-solving-a-linear-system/33921 "2020-02-10T15:59:06Z")

</div>

I am trying to solve a linear system with the direct solver (backslash operator). My matrix is sparse,square and unsymmetric. The system is defined as Ax=b, where A is defined to be a SparseMatrixCSC with dimensions = 8…

---

## [Unknown allocation](https://discourse.julialang.org/t/unknown-allocation/34365)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 5\
**Last updated:** [February 10, 2020, 2:53pm UTC](https://discourse.julialang.org/t/unknown-allocation/34365 "2020-02-10T14:53:17Z")

</div>

I’m trying to do lazy evaluations as follows: struct V data::Vector{Int} end f(v, x) = Base.broadcasted(+, x, v.data) g(v, x) = Base.broadcasted(\*, x, v.data) const x = \[1, 2\] const a = V(\[3, 4\]) const b = V(\[5, 6\]…

---

## [Efficient way to read large array from binary file in slices?](https://discourse.julialang.org/t/efficient-way-to-read-large-array-from-binary-file-in-slices/6847)

<div class="topic-metadata">

**Author:** [@tlnagy](https://discourse.julialang.org/u/tlnagy)\
**Replies:** 12\
**Last updated:** [February 4, 2020, 9:43pm UTC](https://discourse.julialang.org/t/efficient-way-to-read-large-array-from-binary-file-in-slices/6847 "2020-02-04T21:43:33Z")

</div>

I’ve written a TIFF parser (GitHub - tlnagy/OMETIFF.jl: I/O operations for OME-TIFF files in Julia) and there are still some inefficiencies that I would like to fix. One problem is that I allocate a large array that wil…

---

## [Workspace in Julia](https://discourse.julialang.org/t/workspace-in-julia/34122)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 16\
**Last updated:** [February 3, 2020, 11:13pm UTC](https://discourse.julialang.org/t/workspace-in-julia/34122 "2020-02-03T23:13:51Z")

</div>

Hi all, New to Julia, but with experience in HPC. I am looking for a canonical way to have module variables that can be shared between the different functions of the module without having to pass these variables as argu…

---

## [How to create SharedArrays on other workers](https://discourse.julialang.org/t/how-to-create-sharedarrays-on-other-workers/33619)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 9\
**Last updated:** [February 3, 2020, 5:48pm UTC](https://discourse.julialang.org/t/how-to-create-sharedarrays-on-other-workers/33619 "2020-02-03T17:48:05Z")

</div>

I am trying to create a SharedArray on a different worker in julia 1.3.0. Consider the following code snippet: using Distributed addprocs(1) using SharedArrays f = @spawnat 2 SharedVector{Float64}(10) fetch(f) If I …

---

## [Functions of Functions Performance in a Loop](https://discourse.julialang.org/t/functions-of-functions-performance-in-a-loop/34116)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 2\
**Last updated:** [February 3, 2020, 3:45pm UTC](https://discourse.julialang.org/t/functions-of-functions-performance-in-a-loop/34116 "2020-02-03T15:45:42Z")

</div>

For the following two loops, in which a function of a function is called in one, and the computation is more explicit in the other, there is a significant amount of memory allocation in the former. It also takes a perf…

---

## [Rolling maxima](https://discourse.julialang.org/t/rolling-maxima/33845)

<div class="topic-metadata">

**Author:** [@Kruxigt](https://discourse.julialang.org/u/Kruxigt)\
**Replies:** 24\
**Last updated:** [February 2, 2020, 6:08pm UTC](https://discourse.julialang.org/t/rolling-maxima/33845 "2020-02-02T18:08:18Z")

</div>

Hi all fine people here! I am just interested in knowing if anyone here sees any performance improvements in my code. Either algorithmically or Julia specific. The code in question is a function which calculates local …

---

## [Custom stateful transducer performance](https://discourse.julialang.org/t/custom-stateful-transducer-performance/34065)

<div class="topic-metadata">

**Author:** [@Jakub\_Wronowski](https://discourse.julialang.org/u/Jakub_Wronowski)\
**Replies:** 5\
**Last updated:** [February 2, 2020, 3:21pm UTC](https://discourse.julialang.org/t/custom-stateful-transducer-performance/34065 "2020-02-02T15:21:10Z")

</div>

Hi, I am trying to implement a custom stateful transducer, but I am not happy with performance I got. using Transducers using Transducers: Transducer, R\_, next, inner, xform using Transducers: start, complete, wrap, unw…

---

## [Element-wise additions behaviour](https://discourse.julialang.org/t/element-wise-additions-behaviour/33984)

<div class="topic-metadata">

**Author:** [@rpetit](https://discourse.julialang.org/u/rpetit)\
**Replies:** 9\
**Last updated:** [January 30, 2020, 5:04pm UTC](https://discourse.julialang.org/t/element-wise-additions-behaviour/33984 "2020-01-30T17:04:17Z")

</div>

Hi ! I was wondering if someone could explain me the huge gap I noticed in time and memory cost between these two functions. function fwddiff1(γ::Array{T, 2}) where T\<:Real res = zero(γ) for i=1:size(γ)\[1\]-1 …

---

## [Faster way of calculate two-argument ForwardDiff gradient?](https://discourse.julialang.org/t/faster-way-of-calculate-two-argument-forwarddiff-gradient/33948)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 1\
**Last updated:** [January 29, 2020, 8:57pm UTC](https://discourse.julialang.org/t/faster-way-of-calculate-two-argument-forwarddiff-gradient/33948 "2020-01-29T20:57:00Z")

</div>

i have a function f(x1,x2) . sometimes i need dfdx1 , sometimes i need dfdx2, those cases are easy with the existing ForwardDiff API. the problem is when i need the two properties at once. gradient is one way, calling ea…

---

## [Question - for loop - variable assignments](https://discourse.julialang.org/t/question-for-loop-variable-assignments/33934)

<div class="topic-metadata">

**Author:** [@o2candoo](https://discourse.julialang.org/u/o2candoo)\
**Replies:** 5\
**Last updated:** [January 29, 2020, 6:01pm UTC](https://discourse.julialang.org/t/question-for-loop-variable-assignments/33934 "2020-01-29T18:01:18Z")

</div>

Hi Community I’m new to Julia (startet today), so if this question does not fit here, let me know. My first idea was to compare Julias speed for simple calculus with other languages i know (its in this particular area …

---

## [Does defining the type of variables give more speed?](https://discourse.julialang.org/t/does-defining-the-type-of-variables-give-more-speed/33917)

<div class="topic-metadata">

**Author:** [@Darione](https://discourse.julialang.org/u/Darione)\
**Replies:** 2\
**Last updated:** [January 29, 2020, 9:55am UTC](https://discourse.julialang.org/t/does-defining-the-type-of-variables-give-more-speed/33917 "2020-01-29T09:55:44Z")

</div>

Does defining the type of variables give more speed? If I have a generic Dict () and replace it with a Dict with string keys and array elements as values, should I expect a performance improvement? or, when Julia compil…

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

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