# Performance

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

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

**Page:** 61

---

## [Lux.jl Chain of Dense layers don't see speed up going from 32 bits -\> 16 bits](https://discourse.julialang.org/t/lux-jl-chain-of-dense-layers-dont-see-speed-up-going-from-32-bits-16-bits/85419)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 5\
**Last updated:** [August 7, 2022, 8:49am UTC](https://discourse.julialang.org/t/lux-jl-chain-of-dense-layers-dont-see-speed-up-going-from-32-bits-16-bits/85419 "2022-08-07T08:49:54Z")

</div>

using Lux, BenchmarkTools, Random const rng = Random.default\_rng() julia\> let model = Chain( Dense(23, 30, Lux.relu), Dense(30, 25, Lux.relu), Dense(25, 20, Lux.relu…

---

## [Slower with threads](https://discourse.julialang.org/t/slower-with-threads/84600)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 26\
**Last updated:** [August 6, 2022, 5:46pm UTC](https://discourse.julialang.org/t/slower-with-threads/84600 "2022-08-06T17:46:22Z")

</div>

Hello everybody! My actual code takes 16 hours. So I went to learn Parallelism. I started with @task and the execution time went down to 10 hours. Very good! As I have a server with 64 cores, I thought about using @threa…

---

## [Julia vs Python almost the same performance but Python with taichi is 100x faster. Why?And can be improved?](https://discourse.julialang.org/t/julia-vs-python-almost-the-same-performance-but-python-with-taichi-is-100x-faster-why-and-can-be-improved/85239)

<div class="topic-metadata">

**Author:** [@ajsagit](https://discourse.julialang.org/u/ajsagit)\
**Replies:** 13\
**Last updated:** [August 6, 2022, 1:07pm UTC](https://discourse.julialang.org/t/julia-vs-python-almost-the-same-performance-but-python-with-taichi-is-100x-faster-why-and-can-be-improved/85239 "2022-08-06T13:07:33Z")

</div>

Dudes,recently I reviewed Python and the Taichi package. As lots of users mentioned, the performance enchanced almost 100x by Taichi. And, when I compare with the counting primes code between Julia and Python, it seems t…

---

## [Is it possible to add reliable tests that functions do not allocate?](https://discourse.julialang.org/t/is-it-possible-to-add-reliable-tests-that-functions-do-not-allocate/85320)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 4\
**Last updated:** [August 5, 2022, 7:50am UTC](https://discourse.julialang.org/t/is-it-possible-to-add-reliable-tests-that-functions-do-not-allocate/85320 "2022-08-05T07:50:59Z")

</div>

I’m working on a project involving 3D graphics. In this sort of domain, you create a lot of short-term vector and matrix data of a constant size (usually 2D, 3D, and 4D). As well as quaternions, which are stored like a 4…

---

## [Using perf top with non-stdlib julia code](https://discourse.julialang.org/t/using-perf-top-with-non-stdlib-julia-code/85322)

<div class="topic-metadata">

**Author:** [@ikirill](https://discourse.julialang.org/u/ikirill)\
**Replies:** 3\
**Last updated:** [August 5, 2022, 4:46am UTC](https://discourse.julialang.org/t/using-perf-top-with-non-stdlib-julia-code/85322 "2022-08-05T04:46:51Z")

</div>

When running sudo perf top -p $(pidof -s julia) on a running Julia process, none of the function addresses are resolved to names: Samples: 39K of event 'cycles', 4000 Hz, Event count (approx.): 22211461168 lost: 0/0 dro…

---

## [Port conflict when running several nodes on a Slurm cluster](https://discourse.julialang.org/t/port-conflict-when-running-several-nodes-on-a-slurm-cluster/85024)

<div class="topic-metadata">

**Author:** [@matthiasbe](https://discourse.julialang.org/u/matthiasbe)\
**Replies:** 3\
**Last updated:** [August 4, 2022, 1:36pm UTC](https://discourse.julialang.org/t/port-conflict-when-running-several-nodes-on-a-slurm-cluster/85024 "2022-08-04T13:36:58Z")

</div>

Hello, I have trouble running Julia on a cluster. It randomly crashes when trying to connect the workers with addprocs() with error “connection refused”. From what I understand, the problem comes from the fact that sev…

---

## [Pushing to an array which is an element of another array (Modifying an array in an array)](https://discourse.julialang.org/t/pushing-to-an-array-which-is-an-element-of-another-array-modifying-an-array-in-an-array/85179)

<div class="topic-metadata">

**Author:** [@Jonas208](https://discourse.julialang.org/u/Jonas208)\
**Replies:** 11\
**Last updated:** [August 3, 2022, 10:45pm UTC](https://discourse.julialang.org/t/pushing-to-an-array-which-is-an-element-of-another-array-modifying-an-array-in-an-array/85179 "2022-08-03T22:45:41Z")

</div>

Imagine the following situation: I create an array with a fixed size and every element in this array is another array. In a loop, I want to push tuples to one array of the outer array. So I want to modify one array wh…

---

## [Allocations using dualcache](https://discourse.julialang.org/t/allocations-using-dualcache/85244)

<div class="topic-metadata">

**Author:** [@dbs](https://discourse.julialang.org/u/dbs)\
**Replies:** 1\
**Last updated:** [August 3, 2022, 6:07pm UTC](https://discourse.julialang.org/t/allocations-using-dualcache/85244 "2022-08-03T18:07:22Z")

</div>

I have a rather complicated function that I’ve written in a non-allocating manner, and am now trying to use ForwardDiff.jacobian! to generate a non-allocating jacobian. The function has many substeps, so use of a pre-a…

---

## [MQTT message topic parsing optimization](https://discourse.julialang.org/t/mqtt-message-topic-parsing-optimization/85151)

<div class="topic-metadata">

**Author:** [@shindler25](https://discourse.julialang.org/u/shindler25)\
**Replies:** 2\
**Last updated:** [August 3, 2022, 1:23pm UTC](https://discourse.julialang.org/t/mqtt-message-topic-parsing-optimization/85151 "2022-08-03T13:23:58Z")

</div>

Hello, The problem: I am designing an MQTT client using GitHub - rweilbacher/MQTT.jl: An asynchronous MQTT client library for julia and am trying to determine the best way to handle incoming messages. messages are handl…

---

## [Memory on array element assignment](https://discourse.julialang.org/t/memory-on-array-element-assignment/85069)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 10\
**Last updated:** [August 3, 2022, 6:53am UTC](https://discourse.julialang.org/t/memory-on-array-element-assignment/85069 "2022-08-03T06:53:40Z")

</div>

I am writing some sort of histogramming function and am having trouble with bad performance due to dynamic allocations in each assignment. It boils down to the following simple problem: julia\> a=zeros(UInt16,1000000); …

---

## [Appending a matrix to a vector of matrices](https://discourse.julialang.org/t/appending-a-matrix-to-a-vector-of-matrices/85191)

<div class="topic-metadata">

**Author:** [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Replies:** 10\
**Last updated:** [August 2, 2022, 11:30pm UTC](https://discourse.julialang.org/t/appending-a-matrix-to-a-vector-of-matrices/85191 "2022-08-02T23:30:43Z")

</div>

I have a long list (vector) of matrices. They are size 3xn where n is typically 1 \< n \< 7. My long list typically varies between 100K and 1 million. My task is to reduce this list using a rather complicated and expensive…

---

## [Advice on smart multi-threading to minimize calling an expensive function](https://discourse.julialang.org/t/advice-on-smart-multi-threading-to-minimize-calling-an-expensive-function/85152)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 0\
**Last updated:** [August 2, 2022, 9:31am UTC](https://discourse.julialang.org/t/advice-on-smart-multi-threading-to-minimize-calling-an-expensive-function/85152 "2022-08-02T09:31:53Z")

</div>

Hey all! :slight\_smile: I have been struggling a few days now on how to approach this. I have a set of query arrays and a set of reference arrays and I want to compare them. I do this via an index, which is expensive to…

---

## [Different performance between reduce(map()) and mapreduce()](https://discourse.julialang.org/t/different-performance-between-reduce-map-and-mapreduce/85149)

<div class="topic-metadata">

**Author:** [@gwlagerweij](https://discourse.julialang.org/u/gwlagerweij)\
**Replies:** 7\
**Last updated:** [August 2, 2022, 10:55am UTC](https://discourse.julialang.org/t/different-performance-between-reduce-map-and-mapreduce/85149 "2022-08-02T10:55:01Z")

</div>

Hi all, I want to create an array of indices (for creation of a sparse matrix in a later stage) based on a list of element connectivity as follows: N = 10000; # Number of elements ele…

---

## [Basic Performance Difference Between 1.8.0-rc3 and 1.7.2](https://discourse.julialang.org/t/basic-performance-difference-between-1-8-0-rc3-and-1-7-2/85074)

<div class="topic-metadata">

**Author:** [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Replies:** 2\
**Last updated:** [August 1, 2022, 6:20am UTC](https://discourse.julialang.org/t/basic-performance-difference-between-1-8-0-rc3-and-1-7-2/85074 "2022-08-01T06:20:42Z")

</div>

I have both 1.8.0-rc3 and 1.7.2 installed. I am running the simple benchmark using BenchmarkTools; @benchmark a + b setup=(b = rand(Int64); a = rand(Int64)) which from my understanding, should really just be measuring …

---

## [Converting symbolic function to numeric with SymPy](https://discourse.julialang.org/t/converting-symbolic-function-to-numeric-with-sympy/85072)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 4\
**Last updated:** [August 1, 2022, 5:36am UTC](https://discourse.julialang.org/t/converting-symbolic-function-to-numeric-with-sympy/85072 "2022-08-01T05:36:19Z")

</div>

I have using SymPy a = Sym("a") g(a) = a^2 - a g\_prime(a) = diff(g(a)) g\_prime(a) \> 2𝑎−1 I would like to get a function numeric g\_prime(a) that I can plug numbers into and evaluate. How do I do that? The Julia SymPy d…

---

## [Type stability in function involving selectdim](https://discourse.julialang.org/t/type-stability-in-function-involving-selectdim/85009)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 3\
**Last updated:** [July 30, 2022, 7:58pm UTC](https://discourse.julialang.org/t/type-stability-in-function-involving-selectdim/85009 "2022-07-30T19:58:22Z")

</div>

So I’m trying to write a function to perform trapezoidal rule: function trapzNd(A, t; dims=1) N = size(A, dims) dt\_shape = ones(Int64, ndims(A)) dt\_shape\[dims\] = length(t) - 1 dt = reshape(diff(t), …

---

## [Get all changes of sign of some vectors](https://discourse.julialang.org/t/get-all-changes-of-sign-of-some-vectors/77790)

<div class="topic-metadata">

**Author:** [@stla](https://discourse.julialang.org/u/stla)\
**Replies:** 7\
**Last updated:** [July 30, 2022, 5:51pm UTC](https://discourse.julialang.org/t/get-all-changes-of-sign-of-some-vectors/77790 "2022-07-30T17:51:37Z")

</div>

Hello, Given some vectors of numbers, I need to get all vectors obtained from the given ones by assigning the signs + or - to the numbers. For example: vctrs = \[\[0.4; 0.3\], \[0.5; 0.0\]\] julia\> changesOfSign(vctrs) 6-ele…

---

## [Optim interface.jl type instability and efficient exception handling](https://discourse.julialang.org/t/optim-interface-jl-type-instability-and-efficient-exception-handling/84972)

<div class="topic-metadata">

**Author:** [@psterzinger](https://discourse.julialang.org/u/psterzinger)\
**Replies:** 0\
**Last updated:** [July 29, 2022, 11:32am UTC](https://discourse.julialang.org/t/optim-interface-jl-type-instability-and-efficient-exception-handling/84972 "2022-07-29T11:32:29Z")

</div>

Hi, I am currently trying to optimize a simulation that involves repeated parameter estimation, which I do with Optim.jl’s optimize with supplied gradients and hessians. interjace.jl type instability Looking at the fl…

---

## [Is there such a thing like a pushcopy!(...)?](https://discourse.julialang.org/t/is-there-such-a-thing-like-a-pushcopy/84930)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 5\
**Last updated:** [July 28, 2022, 6:41pm UTC](https://discourse.julialang.org/t/is-there-such-a-thing-like-a-pushcopy/84930 "2022-07-28T18:41:07Z")

</div>

Hi, I was wondering if there’s an option or a function in base that pushes a copy rather than a reference into a collection, similarly to what pushcopy!(collection::AbstractVector, item::AbstractArray) = push!(collecti…

---

## [Type stability when having function as struct field](https://discourse.julialang.org/t/type-stability-when-having-function-as-struct-field/84838)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 6\
**Last updated:** [July 26, 2022, 10:18pm UTC](https://discourse.julialang.org/t/type-stability-when-having-function-as-struct-field/84838 "2022-07-26T22:18:45Z")

</div>

I have defined a struct called ParDemo1 to store some parameters (and do some basic calculations for default values not shown here). It is passed to the function dhdt\_demo!, which is the RHS of a system of ODE to be pass…

---

## [How do I do real-time rendering with CUDA.jl?](https://discourse.julialang.org/t/how-do-i-do-real-time-rendering-with-cuda-jl/84820)

<div class="topic-metadata">

**Author:** [@AeroSoap](https://discourse.julialang.org/u/AeroSoap)\
**Replies:** 5\
**Last updated:** [July 26, 2022, 4:04pm UTC](https://discourse.julialang.org/t/how-do-i-do-real-time-rendering-with-cuda-jl/84820 "2022-07-26T16:04:16Z")

</div>

I’ve spent a couple of hours looking around online and haven’t found a good solution, so I think I’ve put in the effort necessary to justify asking here. How would one easily go about taking something like a CuArray from…

---

## [Gaussian Elimination Function that is Fast](https://discourse.julialang.org/t/gaussian-elimination-function-that-is-fast/84714)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 6\
**Last updated:** [July 25, 2022, 12:14pm UTC](https://discourse.julialang.org/t/gaussian-elimination-function-that-is-fast/84714 "2022-07-25T12:14:28Z")

</div>

I was testing this package from this repository, it is faster than A \\ b I do not know any other competitor for calculating Gaussian Elimination that can be measured with @time. If anyone knows, I would like to know an…

---

## [Fast way of selecting rows in DataFrames / csv-file with primary keys](https://discourse.julialang.org/t/fast-way-of-selecting-rows-in-dataframes-csv-file-with-primary-keys/84535)

<div class="topic-metadata">

**Author:** [@pjuergens](https://discourse.julialang.org/u/pjuergens)\
**Replies:** 4\
**Last updated:** [July 25, 2022, 10:41am UTC](https://discourse.julialang.org/t/fast-way-of-selecting-rows-in-dataframes-csv-file-with-primary-keys/84535 "2022-07-25T10:41:04Z")

</div>

Hello together, I’m trying to migrate old code from another language to Julia and doing my first steps in Julia by that. I have a csv-File (approx 100 columns, 6000 rows) that comes from a database with primary keys. Wh…

---

## [Why am I getting the message Failed to Revise](https://discourse.julialang.org/t/why-am-i-getting-the-message-failed-to-revise/84675)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 2\
**Last updated:** [July 24, 2022, 12:05am UTC](https://discourse.julialang.org/t/why-am-i-getting-the-message-failed-to-revise/84675 "2022-07-24T00:05:04Z")

</div>

I installed the package FinancialToolbox, and tested it as recommended: Pkg.test("FinancialToolbox") The package passed the test but there was a ‘Failed tp Revise’ message. There was a also a recommendation to try Revi…

---

## [OpenBLAS much slower on Windows than Linux](https://discourse.julialang.org/t/openblas-much-slower-on-windows-than-linux/84562)

<div class="topic-metadata">

**Author:** [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Replies:** 4\
**Last updated:** [July 23, 2022, 1:09am UTC](https://discourse.julialang.org/t/openblas-much-slower-on-windows-than-linux/84562 "2022-07-23T01:09:21Z")

</div>

This is a continuation of a discussion in issues 159 and 166 of LinearSolve.jl. I have two computers with similar, 8-core i7-9700 CPUs, one of which runs Windows and the other Manjaro Linux. I ran the benchmark script …

---

## [Allocation help - preforming computations over loops](https://discourse.julialang.org/t/allocation-help-preforming-computations-over-loops/84607)

<div class="topic-metadata">

**Author:** [@cosmia](https://discourse.julialang.org/u/cosmia)\
**Replies:** 7\
**Last updated:** [July 21, 2022, 10:33pm UTC](https://discourse.julialang.org/t/allocation-help-preforming-computations-over-loops/84607 "2022-07-21T22:33:19Z")

</div>

I am trying to optimize my code and I’ve tried to follow all performance tips in the manual and browsing the forum. I’ve avoided slicing arrays with @views, made sure to pre-allocate arrays, etc. However, I don’t really …

---

## [Generating a sysimage from running julia system](https://discourse.julialang.org/t/generating-a-sysimage-from-running-julia-system/84464)

<div class="topic-metadata">

**Author:** [@aleReimondo](https://discourse.julialang.org/u/aleReimondo)\
**Replies:** 6\
**Last updated:** [July 21, 2022, 8:57pm UTC](https://discourse.julialang.org/t/generating-a-sysimage-from-running-julia-system/84464 "2022-07-21T20:57:01Z")

</div>

My system is running, some of the functions has run many times (are actually optimized), there are functions that has been added/overwritten by humman interaction during runtime. I want to generate a sysimage with all f…

---

## [Everything precompiling when opening new notebook](https://discourse.julialang.org/t/everything-precompiling-when-opening-new-notebook/84581)

<div class="topic-metadata">

**Author:** [@Andy2K11](https://discourse.julialang.org/u/Andy2K11)\
**Replies:** 8\
**Last updated:** [July 21, 2022, 4:52pm UTC](https://discourse.julialang.org/t/everything-precompiling-when-opening-new-notebook/84581 "2022-07-21T16:52:32Z")

</div>

Yesterday I was in the machine learning workshop and following along having successfully followed all the setup instructions. At some point we were asked to open a new notebook and it took over 11 minutes before I’d done…

---

## [Speeding up some non-optimized Julia functions](https://discourse.julialang.org/t/speeding-up-some-non-optimized-julia-functions/84358)

<div class="topic-metadata">

**Author:** [@O\_Julia](https://discourse.julialang.org/u/O_Julia)\
**Replies:** 47\
**Last updated:** [July 19, 2022, 7:09pm UTC](https://discourse.julialang.org/t/speeding-up-some-non-optimized-julia-functions/84358 "2022-07-19T19:09:07Z")

</div>

Hi, I am converting some of my Python codes to Julia language. For minimal working example, I have simplified most time consuming part of my codes and give them below. In the current version. The Python codes are approxi…

---

## [Where does this allocation come from and how to avoid it? StaticArrays and structures](https://discourse.julialang.org/t/where-does-this-allocation-come-from-and-how-to-avoid-it-staticarrays-and-structures/84462)

<div class="topic-metadata">

**Author:** [@coloboquito](https://discourse.julialang.org/u/coloboquito)\
**Replies:** 3\
**Last updated:** [July 19, 2022, 2:50pm UTC](https://discourse.julialang.org/t/where-does-this-allocation-come-from-and-how-to-avoid-it-staticarrays-and-structures/84462 "2022-07-19T14:50:13Z")

</div>

Hello! I’m trying to optimize my code and I’m stuck on this. Here is a minimum working example of my problem. f(x :: T, y :: T, z :: T) = SA\[x, y, z\] struct Foo{T \<: Real} x :: T; y :: T; z :: T end f(foo :: Foo…

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

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