# Performance

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

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

**Page:** 143

---

## [Craig-Bampton method on large problems](https://discourse.julialang.org/t/craig-bampton-method-on-large-problems/10696)

<div class="topic-metadata">

**Author:** [@mrapo](https://discourse.julialang.org/u/mrapo)\
**Replies:** 1\
**Last updated:** [May 4, 2018, 10:41am UTC](https://discourse.julialang.org/t/craig-bampton-method-on-large-problems/10696 "2018-05-04T10:41:32Z")

</div>

I’ve implemented the Craig-Bampton method for model reduction at https://github.com/JuliaFEM/ModelReduction.jl/blob/master/src/craig\_bampton.jl. Now I would like to perform the reduction on very large models (at least 1 …

---

## [Better performance to blockwise matrix multiplication](https://discourse.julialang.org/t/better-performance-to-blockwise-matrix-multiplication/10677)

<div class="topic-metadata">

**Author:** [@mrapo](https://discourse.julialang.org/u/mrapo)\
**Replies:** 2\
**Last updated:** [May 3, 2018, 9:55am UTC](https://discourse.julialang.org/t/better-performance-to-blockwise-matrix-multiplication/10677 "2018-05-03T09:55:33Z")

</div>

The following function makes it possible to perform blockwise matrix multiplication that results in a very large matrix. Basically the arrays are sliced into smaller blocks which are then multiplied and the final matrix …

---

## [Native Julia gemm implementation](https://discourse.julialang.org/t/native-julia-gemm-implementation/10615)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 16\
**Last updated:** [May 3, 2018, 8:06am UTC](https://discourse.julialang.org/t/native-julia-gemm-implementation/10615 "2018-05-03T08:06:43Z")

</div>

Hi, I continue my Julia exploration and I am very impressed by the performance and the expressiveness of the language. The generated binary code looks very good and the SIMD instructions are efficiently used. Does anyo…

---

## [Cumsum and TiledIteration](https://discourse.julialang.org/t/cumsum-and-tilediteration/10656)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 1\
**Last updated:** [May 2, 2018, 3:18pm UTC](https://discourse.julialang.org/t/cumsum-and-tilediteration/10656 "2018-05-02T15:18:53Z")

</div>

In a mailing list in another galaxy, far far away, someone posted a question regarding taking the cumulative sum along the axes of a 3 dimensional array. Julia has the cumsum function for this. I am asking myself if …

---

## [Best way to download data from a remote URL directly into JuliaDB](https://discourse.julialang.org/t/best-way-to-download-data-from-a-remote-url-directly-into-juliadb/10467)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 2\
**Last updated:** [April 25, 2018, 6:19pm UTC](https://discourse.julialang.org/t/best-way-to-download-data-from-a-remote-url-directly-into-juliadb/10467 "2018-04-25T18:19:06Z")

</div>

I am trying to download a time series from a remote URL (the European Central Bank Statistical Data Warehouse) into JuliaDB. Would like to simply pass the URL to a loadtable function. I am able to load ttime-series into …

---

## [Sorting inhomogeneous tuples on 0.62](https://discourse.julialang.org/t/sorting-inhomogeneous-tuples-on-0-62/10539)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 2\
**Last updated:** [April 25, 2018, 4:49pm UTC](https://discourse.julialang.org/t/sorting-inhomogeneous-tuples-on-0-62/10539 "2018-04-25T16:49:32Z")

</div>

I need to sort arrays of inhomogeneous tuples. On julia 0.62, something is bad, performance wise, which was luckily fixed in 0.7. I wanted to ask whether anyone knows workarounds on 0.6. Sample code below: rr = \[(rand(…

---

## [Redefining an integer makes computing time blow up](https://discourse.julialang.org/t/redefining-an-integer-makes-computing-time-blow-up/10535)

<div class="topic-metadata">

**Author:** [@plapplop](https://discourse.julialang.org/u/plapplop)\
**Replies:** 5\
**Last updated:** [April 25, 2018, 4:28pm UTC](https://discourse.julialang.org/t/redefining-an-integer-makes-computing-time-blow-up/10535 "2018-04-25T16:28:06Z")

</div>

This topic is a follow-up of this one: Improve performance of matrix computation where @foobar\_lv2 proposed an improved version for the computation of a matrix given some three other matrices x, \\mu and \\sigma of respect…

---

## [Improve performance of matrix computation](https://discourse.julialang.org/t/improve-performance-of-matrix-computation/10503)

<div class="topic-metadata">

**Author:** [@plapplop](https://discourse.julialang.org/u/plapplop)\
**Replies:** 10\
**Last updated:** [April 25, 2018, 11:35am UTC](https://discourse.julialang.org/t/improve-performance-of-matrix-computation/10503 "2018-04-25T11:35:37Z")

</div>

I’m implementing a clustering algorithm where N is the number of samples, D the number of features and K the number of clusters. For each cluster 1 \\leq k \\leq K, I have to compute a probability that an individual belong…

---

## [Nested functions with  SubArray argument](https://discourse.julialang.org/t/nested-functions-with-subarray-argument/10502)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 5\
**Last updated:** [April 24, 2018, 6:21pm UTC](https://discourse.julialang.org/t/nested-functions-with-subarray-argument/10502 "2018-04-24T18:21:33Z")

</div>

Hi, I compare the performances of 3 functions implementing X.+=1 where X is a 2D Array of float. shift2D\_1D! splits the 2D loop in two nested functions. shift2DLoop! uses a single function with a 2D loop nest, s…

---

## [Performance of logarithm calculation (when not to use the dot operator?)](https://discourse.julialang.org/t/performance-of-logarithm-calculation-when-not-to-use-the-dot-operator/10504)

<div class="topic-metadata">

**Author:** [@lwabeke](https://discourse.julialang.org/u/lwabeke)\
**Replies:** 3\
**Last updated:** [April 24, 2018, 1:05pm UTC](https://discourse.julialang.org/t/performance-of-logarithm-calculation-when-not-to-use-the-dot-operator/10504 "2018-04-24T13:05:41Z")

</div>

Edits for improved clarify in italics I realised last week just how slow the log() function really is, as an example, comparing log() to fft(), it turns out log() is about 2 times slower, even though it is working on in…

---

## [Performance differences when using a mutable struct that contains an array](https://discourse.julialang.org/t/performance-differences-when-using-a-mutable-struct-that-contains-an-array/10494)

<div class="topic-metadata">

**Author:** [@Bernd\_Blasius](https://discourse.julialang.org/u/Bernd_Blasius)\
**Replies:** 5\
**Last updated:** [April 24, 2018, 10:05am UTC](https://discourse.julialang.org/t/performance-differences-when-using-a-mutable-struct-that-contains-an-array/10494 "2018-04-24T10:05:11Z")

</div>

Hi, I found some strange performance issues in a simple code, using a mutable struct that contains an array and an index to the array as fields. In the simplified example below I compare four different function that fil…

---

## [Broadcast call for closures vs callabe objects](https://discourse.julialang.org/t/broadcast-call-for-closures-vs-callabe-objects/10461)

<div class="topic-metadata">

**Author:** [@spalato](https://discourse.julialang.org/u/spalato)\
**Replies:** 3\
**Last updated:** [April 23, 2018, 3:32pm UTC](https://discourse.julialang.org/t/broadcast-call-for-closures-vs-callabe-objects/10461 "2018-04-23T15:32:03Z")

</div>

Hi, I’ve got a problem that can be nicely solved with closures. I’ve explored the alternative, which is to make a custom callable object. I would like to dispatch them both as a function, so I’ve also tried making that …

---

## [Type stability of \`quadgk\`](https://discourse.julialang.org/t/type-stability-of-quadgk/10006)

<div class="topic-metadata">

**Author:** [@kaslusimoes](https://discourse.julialang.org/u/kaslusimoes)\
**Replies:** 3\
**Last updated:** [April 23, 2018, 2:48pm UTC](https://discourse.julialang.org/t/type-stability-of-quadgk/10006 "2018-04-23T14:48:35Z")

</div>

Hi, I am doing several calculations using QuadGK inside functions and I’m trying to optimize the performance of my code. Not sure if it is the correct procedure but I started looking for type instabilities in my functio…

---

## [Is there any backsolve function in JULIA (for triangual matrices)?](https://discourse.julialang.org/t/is-there-any-backsolve-function-in-julia-for-triangual-matrices/10470)

<div class="topic-metadata">

**Author:** [@dpanigo](https://discourse.julialang.org/u/dpanigo)\
**Replies:** 4\
**Last updated:** [April 22, 2018, 3:26pm UTC](https://discourse.julialang.org/t/is-there-any-backsolve-function-in-julia-for-triangual-matrices/10470 "2018-04-22T15:26:35Z")

</div>

Dear Julia users (and developers): We are using the QR decomposition to obtain standard deviations of our beta coefficients (in an OLS linear model) through the “standard way”: Obtaining the variance-covariance matrix…

---

## [Mapslices and cumsum](https://discourse.julialang.org/t/mapslices-and-cumsum/10422)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 2\
**Last updated:** [April 22, 2018, 10:03am UTC](https://discourse.julialang.org/t/mapslices-and-cumsum/10422 "2018-04-22T10:03:13Z")

</div>

I’m finding that the following code grinds my machine to a halt: n=10^6; X = randn(1,n); function V(x) return 0.5 \* dot(x,x); end avgX = cumsum(mapslices(V,X,1))./(1:n); And by halt, I mean, I had to do a hard rese…

---

## [Dividing matrix into sections](https://discourse.julialang.org/t/dividing-matrix-into-sections/10428)

<div class="topic-metadata">

**Author:** [@abshej](https://discourse.julialang.org/u/abshej)\
**Replies:** 12\
**Last updated:** [April 21, 2018, 6:01am UTC](https://discourse.julialang.org/t/dividing-matrix-into-sections/10428 "2018-04-21T06:01:55Z")

</div>

How to divide a matrix like m x n or an Array like m x n x 1 into topographic sections? Imagine dividing a square into smaller squares. And operating individually on those sections. Edit: The actual problem is that I w…

---

## [Multiprocessing in LAPACK is gone](https://discourse.julialang.org/t/multiprocessing-in-lapack-is-gone/10448)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 0\
**Last updated:** [April 20, 2018, 2:50am UTC](https://discourse.julialang.org/t/multiprocessing-in-lapack-is-gone/10448 "2018-04-20T02:50:07Z")

</div>

Hello everyone, I had built my own Julia excutable because I need to install CUDAdrv. But I was probably not aware of the multiprocessing options. Now when I call eigfact(), there is always only one core running, but on…

---

## [Julia not using full CPU when running inside a GNU Screen session (edit: not a Julia isse](https://discourse.julialang.org/t/julia-not-using-full-cpu-when-running-inside-a-gnu-screen-session-edit-not-a-julia-isse/10430)

<div class="topic-metadata">

**Author:** [@Axel\_Gagge](https://discourse.julialang.org/u/Axel_Gagge)\
**Replies:** 3\
**Last updated:** [April 19, 2018, 1:00pm UTC](https://discourse.julialang.org/t/julia-not-using-full-cpu-when-running-inside-a-gnu-screen-session-edit-not-a-julia-isse/10430 "2018-04-19T13:00:48Z")

</div>

EDIT: the following is not a Julia issue, I notice exactly the same problem using Numpy. The following code: x=rand(10000,10000); x\*x shows ~800% CPU usage according to top (I have 8 cores). When running Julia within …

---

## [Why is Vector{Float64} much faster than Vector{Float32}?](https://discourse.julialang.org/t/why-is-vector-float64-much-faster-than-vector-float32/10328)

<div class="topic-metadata">

**Author:** [@jinliangwei](https://discourse.julialang.org/u/jinliangwei)\
**Replies:** 5\
**Last updated:** [April 14, 2018, 5:52pm UTC](https://discourse.julialang.org/t/why-is-vector-float64-much-faster-than-vector-float32/10328 "2018-04-14T17:52:19Z")

</div>

I have two programs that are almost identical except that in one program I used Float32 vectors or arrays while in the other one I used Float64. The Float64 program (named prog\_f64.jl) is about 5x faster than the Float32…

---

## [QR decomposition in julia 2x slower than octave](https://discourse.julialang.org/t/qr-decomposition-in-julia-2x-slower-than-octave/10043)

<div class="topic-metadata">

**Author:** [@mrcinv](https://discourse.julialang.org/u/mrcinv)\
**Replies:** 17\
**Last updated:** [April 14, 2018, 2:34am UTC](https://discourse.julialang.org/t/qr-decomposition-in-julia-2x-slower-than-octave/10043 "2018-04-14T02:34:48Z")

</div>

I noticed that QR decomposition is 2x slower in julia than octave. For example on my computer I get julia\> A = rand(5000, 5000); @time qr(A); 27.075522 seconds (37 allocations: 765.687 MiB, 0.83% gc time) and \>\> A=ra…

---

## [Rules of thumb for choosing between storing information as struct field or static parameters](https://discourse.julialang.org/t/rules-of-thumb-for-choosing-between-storing-information-as-struct-field-or-static-parameters/10202)

<div class="topic-metadata">

**Author:** [@favba](https://discourse.julialang.org/u/favba)\
**Replies:** 8\
**Last updated:** [April 6, 2018, 7:04pm UTC](https://discourse.julialang.org/t/rules-of-thumb-for-choosing-between-storing-information-as-struct-field-or-static-parameters/10202 "2018-04-06T19:04:57Z")

</div>

TLDR; When is it interesting to “store” field values as static parameters instead of struct fields? as in struct test{fieldA #= This is a Tuple{Int,Int}=#} fieldB::Vector{Int} end vs struct test fieldA::Tuple…

---

## [some question about Ipopt package](https://discourse.julialang.org/t/some-question-about-ipopt-package/10150)

<div class="topic-metadata">

**Author:** [@Jelly](https://discourse.julialang.org/u/Jelly)\
**Replies:** 6\
**Last updated:** [April 6, 2018, 3:33am UTC](https://discourse.julialang.org/t/some-question-about-ipopt-package/10150 "2018-04-06T03:33:56Z")

</div>

After i install Ipopt for Julia , when i execute Pkg.test(“Ipopt”) , it come errors with \*\* ERROR: LoadError: UndefVarError: use\_BinaryProvider not defined ERROR: LoadError: Failed to precompile Ipopt to d:\\JuliaPro-…

---

## [ForwardDiff and GradientConfig memory usage](https://discourse.julialang.org/t/forwarddiff-and-gradientconfig-memory-usage/10145)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 10\
**Last updated:** [April 5, 2018, 4:46pm UTC](https://discourse.julialang.org/t/forwarddiff-and-gradientconfig-memory-usage/10145 "2018-04-05T16:46:39Z")

</div>

I noticed the following issue when trying to minimize my memory allocation while using ForwardDiff.gradient! . My example looks like: using ForwardDiff function run0(x, f, n) out = similar(x); cfg = Forwar…

---

## [Parallel windowing](https://discourse.julialang.org/t/parallel-windowing/10170)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 6\
**Last updated:** [April 5, 2018, 7:22am UTC](https://discourse.julialang.org/t/parallel-windowing/10170 "2018-04-05T07:22:24Z")

</div>

To determine the values of a simple moving average, where the length of the MA window is much smaller than the length of the data vector, one may … and usually does … run through the data sequentially, moving the window …

---

## [Performance of findfirst in 0.7](https://discourse.julialang.org/t/performance-of-findfirst-in-0-7/10160)

<div class="topic-metadata">

**Author:** [@sambitdash](https://discourse.julialang.org/u/sambitdash)\
**Replies:** 10\
**Last updated:** [April 4, 2018, 9:02pm UTC](https://discourse.julialang.org/t/performance-of-findfirst-in-0-7/10160 "2018-04-04T21:02:55Z")

</div>

Hi All, The performance of findfirst(A, value) has significantly been affected in 0.7. It’s understandable that the method is deprecated. But changing the functionality in a manner that performance is substantially affe…

---

## [How to speed up the Interpolation](https://discourse.julialang.org/t/how-to-speed-up-the-interpolation/10147)

<div class="topic-metadata">

**Author:** [@Wonki\_Lee](https://discourse.julialang.org/u/Wonki_Lee)\
**Replies:** 7\
**Last updated:** [April 4, 2018, 10:31am UTC](https://discourse.julialang.org/t/how-to-speed-up-the-interpolation/10147 "2018-04-04T10:31:01Z")

</div>

Hi all ~. Currently, I want to make a function that returns numerical integration through interpolation. But my array is large(~10^7) which takes extreme amounts of allocations & memory. Here’s my code. unit\_q = colle…

---

## [Boltzmann Factor in a loop](https://discourse.julialang.org/t/boltzmann-factor-in-a-loop/10086)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 38\
**Last updated:** [April 3, 2018, 9:30pm UTC](https://discourse.julialang.org/t/boltzmann-factor-in-a-loop/10086 "2018-04-03T21:30:22Z")

</div>

I was looking at the performance of a Monte Carlo method with @cortner and he observed there was some unanticipated behavior in the computation of the Boltzmann factor, e^{-\\beta V(x)}, within the loop. The following is…

---

## [How can I speed up calling python function?](https://discourse.julialang.org/t/how-can-i-speed-up-calling-python-function/10135)

<div class="topic-metadata">

**Author:** [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Replies:** 2\
**Last updated:** [April 3, 2018, 2:48pm UTC](https://discourse.julialang.org/t/how-can-i-speed-up-calling-python-function/10135 "2018-04-03T14:48:43Z")

</div>

I would like to use the openai gym in julia. Thanks to PyCall this is very easy. The only downside is that my naive approach seems to be pretty slow. To demonstrate this, I use a minimal example with numpy. I observe qu…

---

## [Curious regression](https://discourse.julialang.org/t/curious-regression/10108)

<div class="topic-metadata">

**Author:** [@stabbles](https://discourse.julialang.org/u/stabbles)\
**Replies:** 0\
**Last updated:** [April 1, 2018, 10:31pm UTC](https://discourse.julialang.org/t/curious-regression/10108 "2018-04-01T22:31:46Z")

</div>

A while ago I found a curious performance regression in a very simple change to the sparse mat-vec product. Today I tried the same on Julia 0.7 and the results were exactly the opposite\*: \> bench() # Julia 0.6.2 (Trial(…

---

## [struct{N} with internal NTuple{N,Int32}](https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 2\
**Last updated:** [March 30, 2018, 11:09am UTC](https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070 "2018-03-30T11:09:41Z")

</div>

I would like to use something like this: struct Digits{N} \<: Signed digits::NTuple{N, Int32} # ... end There can be many distinct values of N. Is there an approach which allows me the internalized tuple and …

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

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