# Performance

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

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

**Page:** 63

---

## [How to update a data set using another data set?](https://discourse.julialang.org/t/how-to-update-a-data-set-using-another-data-set/80203)

<div class="topic-metadata">

**Author:** [@mostafa1342004](https://discourse.julialang.org/u/mostafa1342004)\
**Replies:** 5\
**Last updated:** [July 1, 2022, 9:30am UTC](https://discourse.julialang.org/t/how-to-update-a-data-set-using-another-data-set/80203 "2022-07-01T09:30:33Z")

</div>

I have a master data set and I like to update some of its values using a transaction data set. There are some key columns for finding the rows that must be updated in both data sets. I know about update! function but the…

---

## [Why other calculation will effect the time consumed by Threads.@threads](https://discourse.julialang.org/t/why-other-calculation-will-effect-the-time-consumed-by-threads-threads/83602)

<div class="topic-metadata">

**Author:** [@wly](https://discourse.julialang.org/u/wly)\
**Replies:** 0\
**Last updated:** [July 1, 2022, 8:17am UTC](https://discourse.julialang.org/t/why-other-calculation-will-effect-the-time-consumed-by-threads-threads/83602 "2022-07-01T08:17:49Z")

</div>

When I test my code, I found that the time consumed by Threads.@threads in actual environment is bigger than the test environment. And I think the reason is that other calculation in the actual environment effects the pe…

---

## [Does @simd hang Base.Threads.@spawn?](https://discourse.julialang.org/t/does-simd-hang-base-threads-spawn/83114)

<div class="topic-metadata">

**Author:** [@Nick\_Matzke](https://discourse.julialang.org/u/Nick_Matzke)\
**Replies:** 11\
**Last updated:** [June 30, 2022, 10:14am UTC](https://discourse.julialang.org/t/does-simd-hang-base-threads-spawn/83114 "2022-06-30T10:14:19Z")

</div>

Hi all, I have an expensive function, f(x), that is embarassingly parallel. E.g. I have to run f(x) 300 times on different x, and each f(x) can take 20 seconds. I wrote a function to parallelize the above, and it work…

---

## [DifferentialEquations.jl How to speed up the solver](https://discourse.julialang.org/t/differentialequations-jl-how-to-speed-up-the-solver/83549)

<div class="topic-metadata">

**Author:** [@Nalaka](https://discourse.julialang.org/u/Nalaka)\
**Replies:** 3\
**Last updated:** [June 30, 2022, 9:32am UTC](https://discourse.julialang.org/t/differentialequations-jl-how-to-speed-up-the-solver/83549 "2022-06-30T09:32:26Z")

</div>

I am using Julia to solve set of differential equations of a omni-wheeled mobile robot. It took 1264.41 sec (21.07 min) to solve the system (But in mathematica, it took less than 4s). In the time, it showed 99% time is f…

---

## [Efficient Evaluation of a Matrix of Function Products](https://discourse.julialang.org/t/efficient-evaluation-of-a-matrix-of-function-products/83466)

<div class="topic-metadata">

**Author:** [@martintb](https://discourse.julialang.org/u/martintb)\
**Replies:** 8\
**Last updated:** [June 30, 2022, 7:30am UTC](https://discourse.julialang.org/t/efficient-evaluation-of-a-matrix-of-function-products/83466 "2022-06-30T07:30:08Z")

</div>

Hi all, I’m trying to compute every product of two functions of a set of different functions fv (e.g., a set of wavefunctions) at different x to obtain a matrix y for each x of shape NxN where N is the number of functio…

---

## [How to calculate Cross Entropy loss between y\_predict and y\_target on GPU](https://discourse.julialang.org/t/how-to-calculate-cross-entropy-loss-between-y-predict-and-y-target-on-gpu/83429)

<div class="topic-metadata">

**Author:** [@Jack\_N](https://discourse.julialang.org/u/Jack_N)\
**Replies:** 4\
**Last updated:** [June 29, 2022, 3:08am UTC](https://discourse.julialang.org/t/how-to-calculate-cross-entropy-loss-between-y-predict-and-y-target-on-gpu/83429 "2022-06-29T03:08:12Z")

</div>

I have not been able to find out how to calculate the loss between each column of a y\_predict and y\_target matrix as a GPU operation. Please let me know how I can do this. Thank you, Jack

---

## [How to take full advantage of GPU Parallelism on Nested Sequential Data in Flux](https://discourse.julialang.org/t/how-to-take-full-advantage-of-gpu-parallelism-on-nested-sequential-data-in-flux/83128)

<div class="topic-metadata">

**Author:** [@Jack\_N](https://discourse.julialang.org/u/Jack_N)\
**Replies:** 6\
**Last updated:** [June 29, 2022, 12:32am UTC](https://discourse.julialang.org/t/how-to-take-full-advantage-of-gpu-parallelism-on-nested-sequential-data-in-flux/83128 "2022-06-29T00:32:20Z")

</div>

I am making a machine learning model in Flux that needs to analyze nested sequential data (sequences whose elements are each composed of smaller sequences). I have tried to implement the model on my Nvidia GPU but have r…

---

## [Performance of methods to iterate through array](https://discourse.julialang.org/t/performance-of-methods-to-iterate-through-array/83465)

<div class="topic-metadata">

**Author:** [@virtualprocessor](https://discourse.julialang.org/u/virtualprocessor)\
**Replies:** 0\
**Last updated:** [June 28, 2022, 3:00pm UTC](https://discourse.julialang.org/t/performance-of-methods-to-iterate-through-array/83465 "2022-06-28T15:00:26Z")

</div>

I stumbled across this post on the Discourse with a very interesting performance benchmark that goes over a series of methods of iterating through an array: Methods (and results without inbounds): How much can hard-code…

---

## [Making multivariate Kolmogorov-Smirnov benchmarks](https://discourse.julialang.org/t/making-multivariate-kolmogorov-smirnov-benchmarks/75114)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 8\
**Last updated:** [June 26, 2022, 10:01pm UTC](https://discourse.julialang.org/t/making-multivariate-kolmogorov-smirnov-benchmarks/75114 "2022-06-26T22:01:47Z")

</div>

Hey, I’m trying to produce empirical multivariate Kolmogorov-Smirnov benchs to later benchmark an estimator. I have the following code for the moment : # The goal of this file is to compute kolmogorov-smirnov p-values …

---

## [Efficient recursive iteration over self referencing struct](https://discourse.julialang.org/t/efficient-recursive-iteration-over-self-referencing-struct/83322)

<div class="topic-metadata">

**Author:** [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Replies:** 11\
**Last updated:** [June 25, 2022, 11:48pm UTC](https://discourse.julialang.org/t/efficient-recursive-iteration-over-self-referencing-struct/83322 "2022-06-25T23:48:47Z")

</div>

Suppose i have a Node type that may have a reference to itself on one of its fields. What is the most efficient way to implement Base.iterate for this Node type, such that at every iteration we get the next child Node? j…

---

## [Do C++ performance optimisations apply to Julia?](https://discourse.julialang.org/t/do-c-performance-optimisations-apply-to-julia/82567)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 28\
**Last updated:** [June 25, 2022, 8:29pm UTC](https://discourse.julialang.org/t/do-c-performance-optimisations-apply-to-julia/82567 "2022-06-25T20:29:19Z")

</div>

Hello everyone :slight\_smile: I came across a set of tips for optimising C++ raytracing code written by Chris Wyman and wondered how much of it applies to Julia. In total there are 27 tips which I’ll share below along w…

---

## [Variance-Covariance matrix with missing data](https://discourse.julialang.org/t/variance-covariance-matrix-with-missing-data/83312)

<div class="topic-metadata">

**Author:** [@Baba\_Yara\_Fahiz](https://discourse.julialang.org/u/Baba_Yara_Fahiz)\
**Replies:** 5\
**Last updated:** [June 25, 2022, 12:17am UTC](https://discourse.julialang.org/t/variance-covariance-matrix-with-missing-data/83312 "2022-06-25T00:17:39Z")

</div>

I am working with financial data where I have 600 matrices that are all 61 by 25000. I am computing the variance-covariance matrix but running into performance issues because of missing data. The way I am handling the …

---

## [Efficient way to split string at specific index](https://discourse.julialang.org/t/efficient-way-to-split-string-at-specific-index/83115)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 19\
**Last updated:** [June 24, 2022, 3:02pm UTC](https://discourse.julialang.org/t/efficient-way-to-split-string-at-specific-index/83115 "2022-06-24T15:02:57Z")

</div>

I’m currently trying to parse a file whose data lines are composed of 8 character columns without delimiter. Such as \<.. 1..\>\<.. 2..\>\<.. 3..\>\<.. 4..\>\<.. 5..\>\<.. 6..\>\<.. 7..\>\<.. 8..\>\<.. 9..\>\<..10..\> 111111112222222233333…

---

## [Eigenvector for small non-Hermitian matrices](https://discourse.julialang.org/t/eigenvector-for-small-non-hermitian-matrices/83204)

<div class="topic-metadata">

**Author:** [@itzui](https://discourse.julialang.org/u/itzui)\
**Replies:** 6\
**Last updated:** [June 24, 2022, 10:05am UTC](https://discourse.julialang.org/t/eigenvector-for-small-non-hermitian-matrices/83204 "2022-06-24T10:05:53Z")

</div>

I have to calculate the eigenvector and eigenvalues for many (more than 60.000) non-Hermitian 4x4 matrices. I know that this can be slightly speed up by means of using LinearAlgebra.LAPACK.geevx! instead of using the eig…

---

## [Type stability while looping over Tuple](https://discourse.julialang.org/t/type-stability-while-looping-over-tuple/83272)

<div class="topic-metadata">

**Author:** [@NicolasW](https://discourse.julialang.org/u/NicolasW)\
**Replies:** 6\
**Last updated:** [June 24, 2022, 12:41am UTC](https://discourse.julialang.org/t/type-stability-while-looping-over-tuple/83272 "2022-06-24T00:41:59Z")

</div>

In the performance critical part of our code we encountered a type instability. Is there an easy way to resolve this? We have some input struct Sinput{X,D} input::X end s\_input = Sinput{Tuple{Float64,Int64}, 2}((1.3,4…

---

## [Julia vs. Python: Euler's sum of powers conjecture](https://discourse.julialang.org/t/julia-vs-python-eulers-sum-of-powers-conjecture/83262)

<div class="topic-metadata">

**Author:** [@jgforbes](https://discourse.julialang.org/u/jgforbes)\
**Replies:** 16\
**Last updated:** [June 24, 2022, 12:13am UTC](https://discourse.julialang.org/t/julia-vs-python-eulers-sum-of-powers-conjecture/83262 "2022-06-24T00:13:50Z")

</div>

The Julia code on this page is much slower than the Python examples. Euler’s sum of powers conjecture with code examples I wrote a Julia program similar to the fastest Python example: Julia function main() MAX = 25…

---

## [Solving Sparse Linear Systems fast](https://discourse.julialang.org/t/solving-sparse-linear-systems-fast/83071)

<div class="topic-metadata">

**Author:** [@pushkar\_khandare](https://discourse.julialang.org/u/pushkar_khandare)\
**Replies:** 11\
**Last updated:** [June 23, 2022, 11:22am UTC](https://discourse.julialang.org/t/solving-sparse-linear-systems-fast/83071 "2022-06-23T11:22:30Z")

</div>

I want to solve Ax = b where A is a sparse matrix of size 10^5 x 10^5 (around 18 non-zero entries per row), x and b are vectors. A is constant throughout my simulation, while b changes at every step in my loop, and I hav…

---

## [Efficiently resample a large vector?](https://discourse.julialang.org/t/efficiently-resample-a-large-vector/83177)

<div class="topic-metadata">

**Author:** [@JedPhillips](https://discourse.julialang.org/u/JedPhillips)\
**Replies:** 5\
**Last updated:** [June 23, 2022, 10:52am UTC](https://discourse.julialang.org/t/efficiently-resample-a-large-vector/83177 "2022-06-23T10:52:19Z")

</div>

I’m doing some simulations and need to efficiently sample a set of items, and then subset/filter a large vector (1\>million entries) whose elements are contained in the sampled items. Here’s some minimal code. Random.see…

---

## [Immutable struct with an Array slower than a constant global Array](https://discourse.julialang.org/t/immutable-struct-with-an-array-slower-than-a-constant-global-array/83145)

<div class="topic-metadata">

**Author:** [@bchaber](https://discourse.julialang.org/u/bchaber)\
**Replies:** 14\
**Last updated:** [June 23, 2022, 8:26am UTC](https://discourse.julialang.org/t/immutable-struct-with-an-array-slower-than-a-constant-global-array/83145 "2022-06-23T08:26:24Z")

</div>

Hello, I’m trying to write a Lattice Boltzmann Solver in Julia. My initial version strongly relies on global constants (mostly numeric values and Arrays). I’ve tried to use immutable structures that hold the state of my…

---

## [2d finite differences implementation for a Numerical Analysis lecture](https://discourse.julialang.org/t/2d-finite-differences-implementation-for-a-numerical-analysis-lecture/70222)

<div class="topic-metadata">

**Author:** [@vicdolean](https://discourse.julialang.org/u/vicdolean)\
**Replies:** 4\
**Last updated:** [June 23, 2022, 12:22am UTC](https://discourse.julialang.org/t/2d-finite-differences-implementation-for-a-numerical-analysis-lecture/70222 "2022-06-23T00:22:31Z")

</div>

Hi! I’m new to Julia world and would need some help in the transition from Matlab. I am teaching a numerical analysis class where I use finite differences on a two dimensional (cartesian but not necessarily square) doma…

---

## [Radial Basis Finite Difference](https://discourse.julialang.org/t/radial-basis-finite-difference/66379)

<div class="topic-metadata">

**Author:** [@Manisha\_07](https://discourse.julialang.org/u/Manisha_07)\
**Replies:** 2\
**Last updated:** [June 22, 2022, 11:21pm UTC](https://discourse.julialang.org/t/radial-basis-finite-difference/66379 "2022-06-22T23:21:34Z")

</div>

Hello People I was trying to simulate heat equation using Julia by the method of finite difference. I would like to simulate for Radial Basis Finite Difference method also. Please help me to find the code for it my c…

---

## [LinearAlgebra.det and symbolic variables](https://discourse.julialang.org/t/linearalgebra-det-and-symbolic-variables/83054)

<div class="topic-metadata">

**Author:** [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Replies:** 6\
**Last updated:** [June 22, 2022, 3:34pm UTC](https://discourse.julialang.org/t/linearalgebra-det-and-symbolic-variables/83054 "2022-06-22T15:34:08Z")

</div>

I am interested in the computation of the determinant of a (very sparse) matrix involving a symbolic variable. My code is using Symbolics, LinearAlgebra, SparseArrays N = 11 FloatType = Float64 c = zeros(FloatType, …

---

## [Profiling compilation of a large generated expression?](https://discourse.julialang.org/t/profiling-compilation-of-a-large-generated-expression/83179)

<div class="topic-metadata">

**Author:** [@iago-lito](https://discourse.julialang.org/u/iago-lito)\
**Replies:** 4\
**Last updated:** [June 22, 2022, 11:32am UTC](https://discourse.julialang.org/t/profiling-compilation-of-a-large-generated-expression/83179 "2022-06-22T11:32:34Z")

</div>

Hi @Julia, The team I’m working with is writing a simulation package, with a core dudt!(du, u, parameters, t) function given as an argument to ODEProblem and solve from DifferentialEquations. The code in dudt! is comple…

---

## [Simple example of @threads](https://discourse.julialang.org/t/simple-example-of-threads/83049)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 17\
**Last updated:** [June 22, 2022, 6:11am UTC](https://discourse.julialang.org/t/simple-example-of-threads/83049 "2022-06-22T06:11:06Z")

</div>

How can I make this simple example thread safe? function func(R=5) s = 0.0 Threads.@threads :static for i in 1:R s += 1 end return s end If it makes any difference, in my application I am summin…

---

## [Stop allocating memory when replacing structs in for-loops](https://discourse.julialang.org/t/stop-allocating-memory-when-replacing-structs-in-for-loops/83125)

<div class="topic-metadata">

**Author:** [@Joseph\_Bradley](https://discourse.julialang.org/u/Joseph_Bradley)\
**Replies:** 5\
**Last updated:** [June 21, 2022, 3:40pm UTC](https://discourse.julialang.org/t/stop-allocating-memory-when-replacing-structs-in-for-loops/83125 "2022-06-21T15:40:38Z")

</div>

I’m working on a project where I have to simulate many systems and track some observable across the many systems. When I try to create new systems in for-loops, I end up getting allocations of O(n\_trials) when it isn’t n…

---

## [Type-Instability Caused by Wrapping Type-Stable Function](https://discourse.julialang.org/t/type-instability-caused-by-wrapping-type-stable-function/83089)

<div class="topic-metadata">

**Author:** [@dleather](https://discourse.julialang.org/u/dleather)\
**Replies:** 2\
**Last updated:** [June 20, 2022, 8:46pm UTC](https://discourse.julialang.org/t/type-instability-caused-by-wrapping-type-stable-function/83089 "2022-06-20T20:46:03Z")

</div>

The following results are puzzling to me. I have a type-stable function eval\_logprior stored in structure prior\_struct which I type as ::Function. Input: eval\_logprior = prior\_struct.eval\_logprior @code\_warntype eval\_l…

---

## [Taking TTFX seriously: Can we make common packages faster to load and use](https://discourse.julialang.org/t/taking-ttfx-seriously-can-we-make-common-packages-faster-to-load-and-use/74949)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 123\
**Last updated:** [June 20, 2022, 6:19pm UTC](https://discourse.julialang.org/t/taking-ttfx-seriously-can-we-make-common-packages-faster-to-load-and-use/74949 "2022-06-20T18:19:12Z")

</div>

So much work has been done to improve julia compilation and remove invalidations. Things really feel a lot snappier to use. But there is still the problem of packages that were written without much thought to startup ti…

---

## [Overcoming performance hit of accessing struct field](https://discourse.julialang.org/t/overcoming-performance-hit-of-accessing-struct-field/82911)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 11\
**Last updated:** [June 20, 2022, 12:18pm UTC](https://discourse.julialang.org/t/overcoming-performance-hit-of-accessing-struct-field/82911 "2022-06-20T12:18:31Z")

</div>

Hi all, I’m working on a simulator for a Monte Carlo simulation of a spin ising model. I was working with a custom struct holding a few arrays and dicts. As an example, one of the arrays holds 512^2 Int8’s, which repres…

---

## [Massive performance penalty for Float16 compared to Float32](https://discourse.julialang.org/t/massive-performance-penalty-for-float16-compared-to-float32/6864)

<div class="topic-metadata">

**Author:** [@zenon](https://discourse.julialang.org/u/zenon)\
**Replies:** 17\
**Last updated:** [June 20, 2022, 1:15am UTC](https://discourse.julialang.org/t/massive-performance-penalty-for-float16-compared-to-float32/6864 "2022-06-20T01:15:29Z")

</div>

Hello, I just do the Coursera lectures about Deep Leanring by Andrew Ng, and want to implement what I learned in Julia (lecture is in Python), so I can check my understanding. So there is a small neural net, and it take…

---

## [Can macros also be precompiled?](https://discourse.julialang.org/t/can-macros-also-be-precompiled/83032)

<div class="topic-metadata">

**Author:** [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Replies:** 4\
**Last updated:** [June 19, 2022, 10:56pm UTC](https://discourse.julialang.org/t/can-macros-also-be-precompiled/83032 "2022-06-19T22:56:49Z")

</div>

I know that on working on a package, is common to create a precompile.jl file that calls precompile for various methods and the types they may accept as arguments, but i was thinking that the same thing could be done for…

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

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