# Performance

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

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

**Page:** 86

---

## [Mesh grid in Julia](https://discourse.julialang.org/t/mesh-grid-in-julia/66363)

<div class="topic-metadata">

**Author:** [@Manisha\_07](https://discourse.julialang.org/u/Manisha_07)\
**Replies:** 10\
**Last updated:** [August 14, 2021, 2:08pm UTC](https://discourse.julialang.org/t/mesh-grid-in-julia/66363 "2021-08-14T14:08:38Z")

</div>

Hello People I have been working on heat equation simulation using Julia Software. I was stuck with creating a surface plot (3d plotting) I have values of x,t and T (is a matrix) how to make 3d plot Please help me

---

## [What would be an efficient image type to apply a series of JuliaImages filters?](https://discourse.julialang.org/t/what-would-be-an-efficient-image-type-to-apply-a-series-of-juliaimages-filters/66332)

<div class="topic-metadata">

**Author:** [@erwanlecarpentier](https://discourse.julialang.org/u/erwanlecarpentier)\
**Replies:** 4\
**Last updated:** [August 14, 2021, 8:11am UTC](https://discourse.julialang.org/t/what-would-be-an-efficient-image-type-to-apply-a-series-of-juliaimages-filters/66332 "2021-08-14T08:11:30Z")

</div>

Hey! I am applying a series of filters/operations from JuliaImages to images that are initially of type Array{UInt8,2}. What would be the most efficient image type for this kind of computation? Should I always convert b…

---

## [Improving perfomance for a beginner](https://discourse.julialang.org/t/improving-perfomance-for-a-beginner/66353)

<div class="topic-metadata">

**Author:** [@jpmorr](https://discourse.julialang.org/u/jpmorr)\
**Replies:** 3\
**Last updated:** [August 13, 2021, 8:35pm UTC](https://discourse.julialang.org/t/improving-perfomance-for-a-beginner/66353 "2021-08-13T20:35:09Z")

</div>

I’ve recently started a side project at work to see if I can use julia to replace python for the majority of my data processing due to the possible gains in performance. Over the years the python code has become quite qu…

---

## [Code parallelization for Brownian Dynamics simulation of hard spheres](https://discourse.julialang.org/t/code-parallelization-for-brownian-dynamics-simulation-of-hard-spheres/64584)

<div class="topic-metadata">

**Author:** [@Amir\_Abbasi](https://discourse.julialang.org/u/Amir_Abbasi)\
**Replies:** 5\
**Last updated:** [August 13, 2021, 1:47pm UTC](https://discourse.julialang.org/t/code-parallelization-for-brownian-dynamics-simulation-of-hard-spheres/64584 "2021-08-13T13:47:07Z")

</div>

Hi All! I am using Julia to do Brownian dynamics simulation of many hard spheres in 2D and 3D (employing the repulsive LJ interaction). My code is mostly based on SoftSquishymatter.jl package, but the main difference is…

---

## [Speed up applying a function to matrices](https://discourse.julialang.org/t/speed-up-applying-a-function-to-matrices/66241)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 8\
**Last updated:** [August 13, 2021, 1:52am UTC](https://discourse.julialang.org/t/speed-up-applying-a-function-to-matrices/66241 "2021-08-13T01:52:16Z")

</div>

I’ve been struggling to speed up this problem I’m working with. Apologies about posting this long snippet, I couldn’t think of a more minimal example that has all the features stumping me. using BenchmarkTools using Fas…

---

## [Benchmark Tests: Improvements for BenchmarkTools](https://discourse.julialang.org/t/benchmark-tests-improvements-for-benchmarktools/66134)

<div class="topic-metadata">

**Author:** [@viraltux](https://discourse.julialang.org/u/viraltux)\
**Replies:** 16\
**Last updated:** [August 12, 2021, 10:46pm UTC](https://discourse.julialang.org/t/benchmark-tests-improvements-for-benchmarktools/66134 "2021-08-12T22:46:30Z")

</div>

Background In a separate topic discussing why systematic errors appear when using BenchmarkTools, I end up claiming that BenchmarkTools, which happens to be great to measure benchmarks, could introduce improvements when …

---

## [Seeing allocations only when assigning to a Vector of Union{Nothing, Struct} when Struct is immutable, but contains mutable data](https://discourse.julialang.org/t/seeing-allocations-only-when-assigning-to-a-vector-of-union-nothing-struct-when-struct-is-immutable-but-contains-mutable-data/66272)

<div class="topic-metadata">

**Author:** [@Lars\_Wander](https://discourse.julialang.org/u/Lars_Wander)\
**Replies:** 12\
**Last updated:** [August 12, 2021, 8:36pm UTC](https://discourse.julialang.org/t/seeing-allocations-only-when-assigning-to-a-vector-of-union-nothing-struct-when-struct-is-immutable-but-contains-mutable-data/66272 "2021-08-12T20:36:11Z")

</div>

Hello Julia folks, Context: while writing code to search for aperiodic tilings of the plane, I noticed that every assignment to an element of Vector{Union{Nothing, Tile}} was causing an allocation according to --track-a…

---

## [Help with @distributed with an iterator and speed issue](https://discourse.julialang.org/t/help-with-distributed-with-an-iterator-and-speed-issue/66292)

<div class="topic-metadata">

**Author:** [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Replies:** 0\
**Last updated:** [August 12, 2021, 8:01pm UTC](https://discourse.julialang.org/t/help-with-distributed-with-an-iterator-and-speed-issue/66292 "2021-08-12T20:01:56Z")

</div>

I have two questions about the following code (in which I’m looking to get the largest eigenvalue of a matrix by permuting its rows). using LinearAlgebra, Combinatorics, Distributed function maxeig(A::Matrix) retur…

---

## [Pluto: does mardown needs a local installation of LaTeX?](https://discourse.julialang.org/t/pluto-does-mardown-needs-a-local-installation-of-latex/66264)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 2\
**Last updated:** [August 12, 2021, 4:54pm UTC](https://discourse.julialang.org/t/pluto-does-mardown-needs-a-local-installation-of-latex/66264 "2021-08-12T16:54:45Z")

</div>

Hi all, I have a local installation of LaTeX on my computer, and Pluto markdown is running smoothly. I am going to ask a lot of students to install Pluto, and most of them do not have a LaTeX local installation on their…

---

## [Performance depends dramatically on compilation order](https://discourse.julialang.org/t/performance-depends-dramatically-on-compilation-order/58425)

<div class="topic-metadata">

**Author:** [@fverdugo](https://discourse.julialang.org/u/fverdugo)\
**Replies:** 6\
**Last updated:** [August 12, 2021, 2:25pm UTC](https://discourse.julialang.org/t/performance-depends-dramatically-on-compilation-order/58425 "2021-08-12T14:25:23Z")

</div>

Using ProfileView, I have realized that our code base Gridap.jl suffers from runtime dispatch at some performance critical parts. Luckily, I have been able to reduce the problem to a simple MWE and even found a workaroun…

---

## [Dot operation broadcast for a "StaticSparseVector"](https://discourse.julialang.org/t/dot-operation-broadcast-for-a-staticsparsevector/66124)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 5\
**Last updated:** [August 12, 2021, 7:35am UTC](https://discourse.julialang.org/t/dot-operation-broadcast-for-a-staticsparsevector/66124 "2021-08-12T07:35:23Z")

</div>

For various reasons, I want to create a static sparse vector (SSV) type. In contrast to what is done (for matrices) in LuxurySparse.jl, I want the sparsity structure to be part of the data type. I do that by using a re…

---

## [Help to get my slow Julia code to run as fast as Rust/Java/Lisp](https://discourse.julialang.org/t/help-to-get-my-slow-julia-code-to-run-as-fast-as-rust-java-lisp/65741)

<div class="topic-metadata">

**Author:** [@renatoathaydes](https://discourse.julialang.org/u/renatoathaydes)\
**Replies:** 100\
**Last updated:** [August 6, 2021, 1:54am UTC](https://discourse.julialang.org/t/help-to-get-my-slow-julia-code-to-run-as-fast-as-rust-java-lisp/65741 "2021-08-06T01:54:53Z")

</div>

Hi there! I had included some Julia code in a benchmark I’ve run to see how it performs compared to a few other languages. Given what other people say, Julia should be very fast, but the program I wrote is much slower t…

---

## [How to sample from a truncated distribution without allocating too much memory](https://discourse.julialang.org/t/how-to-sample-from-a-truncated-distribution-without-allocating-too-much-memory/66232)

<div class="topic-metadata">

**Author:** [@Frisus95](https://discourse.julialang.org/u/Frisus95)\
**Replies:** 1\
**Last updated:** [August 11, 2021, 10:12pm UTC](https://discourse.julialang.org/t/how-to-sample-from-a-truncated-distribution-without-allocating-too-much-memory/66232 "2021-08-11T22:12:59Z")

</div>

Hello everyone! I’m writing a code that samples millions of times from a truncated distribution. Everything works well and is also enough fast, but I am not satisfied with the memory allocations and the gc time, in my …

---

## [Dispatch checker](https://discourse.julialang.org/t/dispatch-checker/66191)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 8\
**Last updated:** [August 11, 2021, 11:27am UTC](https://discourse.julialang.org/t/dispatch-checker/66191 "2021-08-11T11:27:58Z")

</div>

Having managed to express your if typeof(v) by suitable dispatch calls, how do you check if they are correct or cover all possible cases? Of course, like in other programming languages, one can always code test cases. …

---

## [@turbo on sets of operations](https://discourse.julialang.org/t/turbo-on-sets-of-operations/66068)

<div class="topic-metadata">

**Author:** [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)\
**Replies:** 15\
**Last updated:** [August 10, 2021, 3:10pm UTC](https://discourse.julialang.org/t/turbo-on-sets-of-operations/66068 "2021-08-10T15:10:35Z")

</div>

Hello, I’m thinking of adding LoopVectorization.jl to my code to speed it up. All the examples I’ve found are very short on simple operations within a matrix or vector. My code is not as neat, but I often have to perfor…

---

## [Intermediate results (dereferencing, CSE, ..) - when to avoid?](https://discourse.julialang.org/t/intermediate-results-dereferencing-cse-when-to-avoid/66024)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 6\
**Last updated:** [August 10, 2021, 10:05am UTC](https://discourse.julialang.org/t/intermediate-results-dereferencing-cse-when-to-avoid/66024 "2021-08-10T10:05:04Z")

</div>

A habit tells me to eliminate common subexpressions and to create intermediate variables. On the other hand, Julia’s performance is often judged by its allocations and so seems to suggest avoiding intermediate variables…

---

## [Wrapper{Type{Int}} really needed?](https://discourse.julialang.org/t/wrapper-type-int-really-needed/65877)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 5\
**Last updated:** [August 10, 2021, 8:35am UTC](https://discourse.julialang.org/t/wrapper-type-int-really-needed/65877 "2021-08-10T08:35:09Z")

</div>

Julia’s documentation recommends to wrap types into Type{...} for performance considerations The concrete example in the documentation is julia\> struct WrapType{T} value::T end julia\> WrapType(Float64) #…

---

## [Confused by extra allocations](https://discourse.julialang.org/t/confused-by-extra-allocations/66086)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 4\
**Last updated:** [August 9, 2021, 8:08pm UTC](https://discourse.julialang.org/t/confused-by-extra-allocations/66086 "2021-08-09T20:08:21Z")

</div>

I’ve written a function that loops over a large table and is running slower than I expected. The source of the problem seems to be a huge amount of extra allocations. I’ve created the following minimal example that dem…

---

## [Composing collection of iterators that accept iterators and collecting the result](https://discourse.julialang.org/t/composing-collection-of-iterators-that-accept-iterators-and-collecting-the-result/66082)

<div class="topic-metadata">

**Author:** [@djholiver](https://discourse.julialang.org/u/djholiver)\
**Replies:** 0\
**Last updated:** [August 9, 2021, 4:41pm UTC](https://discourse.julialang.org/t/composing-collection-of-iterators-that-accept-iterators-and-collecting-the-result/66082 "2021-08-09T16:41:25Z")

</div>

Hi, I have a series of methods that return the relevant query indexes for a filter type e.g. “Between(0,500\]” or “name = Julia” that are combined: function queryModelCollection(iQuery :: QueryModels.QueryModel, data :…

---

## [Most of the time spent in \`readdlm\` a txt file](https://discourse.julialang.org/t/most-of-the-time-spent-in-readdlm-a-txt-file/66059)

<div class="topic-metadata">

**Author:** [@daviddoij](https://discourse.julialang.org/u/daviddoij)\
**Replies:** 1\
**Last updated:** [August 9, 2021, 7:42am UTC](https://discourse.julialang.org/t/most-of-the-time-spent-in-readdlm-a-txt-file/66059 "2021-08-09T07:42:09Z")

</div>

Hi there, I’m my attempt to learn Julia, I’m solving project euler problems. In one of them, I found the performance not particularly good, when compared with other languages, e.g., Python. The code in question is the …

---

## [How to parallelize the product of sparse and dense matrices](https://discourse.julialang.org/t/how-to-parallelize-the-product-of-sparse-and-dense-matrices/65602)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 0\
**Last updated:** [July 31, 2021, 2:39pm UTC](https://discourse.julialang.org/t/how-to-parallelize-the-product-of-sparse-and-dense-matrices/65602 "2021-07-31T14:39:21Z")

</div>

This is a general question. Suppose we have a sparse CSR matrix A and a dense column majour matrix B, and we want to calculate the product. In principle, one can parallelize either over the rows of matrix A, or over the…

---

## [How to speed up this function?](https://discourse.julialang.org/t/how-to-speed-up-this-function/66030)

<div class="topic-metadata">

**Author:** [@le\_go](https://discourse.julialang.org/u/le_go)\
**Replies:** 2\
**Last updated:** [August 8, 2021, 6:01pm UTC](https://discourse.julialang.org/t/how-to-speed-up-this-function/66030 "2021-08-08T18:01:30Z")

</div>

Can anyone spot optimizations? using FLoops function go(arr) record = zeros(Float16,1,9) record\_add = zeros(Float16,1,9) uniq = unique(arr\[:,1\]) for (c\_86, c\_90, c\_89\_1, c\_53, c\_52, c\_89, c\_88) in collect(Iterators.…

---

## [Vector of indices vs. for loop to assign values in an array](https://discourse.julialang.org/t/vector-of-indices-vs-for-loop-to-assign-values-in-an-array/66011)

<div class="topic-metadata">

**Author:** [@Valery](https://discourse.julialang.org/u/Valery)\
**Replies:** 4\
**Last updated:** [August 8, 2021, 3:03pm UTC](https://discourse.julialang.org/t/vector-of-indices-vs-for-loop-to-assign-values-in-an-array/66011 "2021-08-08T15:03:47Z")

</div>

Let the following initialisation be. A = zeros(3,3) # 3x3 array of 0 cartId = CartesianIndices(A)\[\[1 2 5 7\]\] # cartesian indices at which some values have to be assigned in A value = rand(length(cartId)) # the values to…

---

## [Julia performance for pointer based data structures?](https://discourse.julialang.org/t/julia-performance-for-pointer-based-data-structures/65992)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [August 7, 2021, 4:53pm UTC](https://discourse.julialang.org/t/julia-performance-for-pointer-based-data-structures/65992 "2021-08-07T16:53:11Z")

</div>

Ignoring GC costs, does the lack of raw pointers cause possible performance issues (compared to C) if you want to implement pointer-based data structures like linked lists and trees? Julia exposes some pointers for C int…

---

## [Length(skipmissing( )) not implemented](https://discourse.julialang.org/t/length-skipmissing-not-implemented/65943)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 7\
**Last updated:** [August 6, 2021, 4:24pm UTC](https://discourse.julialang.org/t/length-skipmissing-not-implemented/65943 "2021-08-06T16:24:48Z")

</div>

julia\> x = \[2.0, missing, 3.0\]; julia\> length(x) 3 julia\> length(skipmissing(x)) ERROR: MethodError: no method matching length(::Base.SkipMissing{Vector{Union{Missing, Float64}}}) julia\> count(a -\> true, skipmissing(x…

---

## [Key BlackBoxOptim not found](https://discourse.julialang.org/t/key-blackboxoptim-not-found/65919)

<div class="topic-metadata">

**Author:** [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Replies:** 1\
**Last updated:** [August 6, 2021, 2:49pm UTC](https://discourse.julialang.org/t/key-blackboxoptim-not-found/65919 "2021-08-06T14:49:00Z")

</div>

Hello, I am examining the parallel computing speed in BlackBoxOptim by optimizing the Rosebrock function using codes adapted from rosenbrock\_parallel.jl by @robertfeldt. The code I run is as follows: using Distributed …

---

## [SplitODEProblem efficiency against classical ODEProblem](https://discourse.julialang.org/t/splitodeproblem-efficiency-against-classical-odeproblem/65232)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 4\
**Last updated:** [August 6, 2021, 10:34am UTC](https://discourse.julialang.org/t/splitodeproblem-efficiency-against-classical-odeproblem/65232 "2021-08-06T10:34:38Z")

</div>

Hello, I read the documentation of the DifferentialEquations.jl package. I had an ODE problem where the RHS is f(u, p, t) = ( L + L(t) ) \* u, where L and L(t) are two sparse matrices (usually 600x600 matrix with a lot …

---

## [Explicitly declaring the ODE Jacobian being less efficiently](https://discourse.julialang.org/t/explicitly-declaring-the-ode-jacobian-being-less-efficiently/65045)

<div class="topic-metadata">

**Author:** [@Caique\_Rodrigues](https://discourse.julialang.org/u/Caique_Rodrigues)\
**Replies:** 16\
**Last updated:** [August 6, 2021, 10:22am UTC](https://discourse.julialang.org/t/explicitly-declaring-the-ode-jacobian-being-less-efficiently/65045 "2021-08-06T10:22:50Z")

</div>

One of the problems that I am solving, without explicitly declaring the jacobian, was being solved in, roughly, 800 seconds. It isn’t that fast, the system is really stiff, but I am trying to optimize it as far as I can.…

---

## [Poor speed gain using \`pmap\`](https://discourse.julialang.org/t/poor-speed-gain-using-pmap/65694)

<div class="topic-metadata">

**Author:** [@Rick](https://discourse.julialang.org/u/Rick)\
**Replies:** 17\
**Last updated:** [August 6, 2021, 8:01am UTC](https://discourse.julialang.org/t/poor-speed-gain-using-pmap/65694 "2021-08-06T08:01:49Z")

</div>

Hi, I am using the pmap function for parallelization. However, the speedup is not satisfactory. The speed gain is very far from linear. As an illustration, I count the time used when each simulation draws 10,000,000 ran…

---

## [How to speed up these functions?](https://discourse.julialang.org/t/how-to-speed-up-these-functions/65728)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 19\
**Last updated:** [August 6, 2021, 12:31am UTC](https://discourse.julialang.org/t/how-to-speed-up-these-functions/65728 "2021-08-06T00:31:36Z")

</div>

I have been working on estimating a model via indirect inference. For that to be feasible I need to speed up these functions that jointly comprise the auxiliary model. Can anyone spot optimizations? set up: using Linea…

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

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