# Performance

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

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

**Page:** 20

---

## [Complexity/implementation of disjoint-set (union-find) in \`DataStructures.jl\`](https://discourse.julialang.org/t/complexity-implementation-of-disjoint-set-union-find-in-datastructures-jl/119050)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 4\
**Last updated:** [September 11, 2024, 4:11pm UTC](https://discourse.julialang.org/t/complexity-implementation-of-disjoint-set-union-find-in-datastructures-jl/119050 "2024-09-11T16:11:10Z")

</div>

I didn’t see it in the docs and am trying to identify what algorithm is used in the implementation of find (and union) in the DisjointSets object in the DataStructures.jl package. find The docs say that “path compressi…

---

## [Where is the excessive memory consumption](https://discourse.julialang.org/t/where-is-the-excessive-memory-consumption/119174)

<div class="topic-metadata">

**Author:** [@Betristor](https://discourse.julialang.org/u/Betristor)\
**Replies:** 13\
**Last updated:** [September 10, 2024, 6:20am UTC](https://discourse.julialang.org/t/where-is-the-excessive-memory-consumption/119174 "2024-09-10T06:20:53Z")

</div>

I have a JuMP model with about 0.2 billion variables. Gurobi reports 50 GB of memory consumption and htop reports consistent 350 GB of memory consumption during solving. I’m most curious about the excessive memory consu…

---

## [Benchmark game challenge and some optimization questions](https://discourse.julialang.org/t/benchmark-game-challenge-and-some-optimization-questions/79653)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 29\
**Last updated:** [January 13, 2024, 7:12pm UTC](https://discourse.julialang.org/t/benchmark-game-challenge-and-some-optimization-questions/79653 "2024-01-13T19:12:59Z")

</div>

First the good news, at the Debian benchmark game, clicking “summary stats”: I see the top graph showing Julia is best for “Geometric Mean - Time plus Source Code size”. \[Then further down a similar graph, at first co…

---

## [When to use Tuples instead of Vectors?](https://discourse.julialang.org/t/when-to-use-tuples-instead-of-vectors/119109)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 16\
**Last updated:** [September 6, 2024, 3:42pm UTC](https://discourse.julialang.org/t/when-to-use-tuples-instead-of-vectors/119109 "2024-09-06T15:42:49Z")

</div>

Hello, I’m developing QuantumToolbox.jl for simulating quantum systems in Julia. Everything is based on the QuantumObject constructor, which is currently defined as follows struct QuantumObject{MT\<:AbstractArray,ObjTyp…

---

## [PRECOMPILATION ERROR-CSVReader](https://discourse.julialang.org/t/precompilation-error-csvreader/119121)

<div class="topic-metadata">

**Author:** [@LAURIE\_ALVEY](https://discourse.julialang.org/u/LAURIE_ALVEY)\
**Replies:** 1\
**Last updated:** [September 6, 2024, 1:30pm UTC](https://discourse.julialang.org/t/precompilation-error-csvreader/119121 "2024-09-06T13:30:37Z")

</div>

precompilation error with CSVReader

---

## [Why operation on return of @views take a long time](https://discourse.julialang.org/t/why-operation-on-return-of-views-take-a-long-time/119088)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 7\
**Last updated:** [September 6, 2024, 12:02pm UTC](https://discourse.julialang.org/t/why-operation-on-return-of-views-take-a-long-time/119088 "2024-09-06T12:02:29Z")

</div>

Hi there, In this scenario, I have a large sparse matrix, and I want to filter out certain rows and columns based on specific conditions, such as: nrow = 10000 ncol = 10000 M = sprand(nrow,ncol,0.0001) rowIdx = rand(Bo…

---

## [Benchmarking array closures](https://discourse.julialang.org/t/benchmarking-array-closures/75689)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 3\
**Last updated:** [September 5, 2024, 6:24pm UTC](https://discourse.julialang.org/t/benchmarking-array-closures/75689 "2024-09-05T18:24:37Z")

</div>

Want to verify that I’ve done this in a way that gives valid results. In the code below dostuff! updates 2 arrays in place. clos! creates a closure that encloses the arrays and accepts arguments for the change factors. …

---

## [Why is Julia's performance more sensitive to memory allocations than Numpy's?](https://discourse.julialang.org/t/why-is-julias-performance-more-sensitive-to-memory-allocations-than-numpys/119013)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 19\
**Last updated:** [September 5, 2024, 7:49am UTC](https://discourse.julialang.org/t/why-is-julias-performance-more-sensitive-to-memory-allocations-than-numpys/119013 "2024-09-05T07:49:15Z")

</div>

This is a general, “deepening my understanding”-type question and it isn’t about a particular piece of code. If you read the performance section of this forum, a common pattern is for people to write code that does som…

---

## [Multiple Methods](https://discourse.julialang.org/t/multiple-methods/119006)

<div class="topic-metadata">

**Author:** [@Mirsad\_Cosovic](https://discourse.julialang.org/u/Mirsad_Cosovic)\
**Replies:** 10\
**Last updated:** [September 4, 2024, 2:05am UTC](https://discourse.julialang.org/t/multiple-methods/119006 "2024-09-04T02:05:27Z")

</div>

Hello, I have multiple methods with the same name but different argument types. When I add a fourth method with a distinct argument type, I observe a significant increase in memory allocations during the first run. I un…

---

## [Type stable specializations of \`getproperty\` without code duplication?](https://discourse.julialang.org/t/type-stable-specializations-of-getproperty-without-code-duplication/92404)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 20\
**Last updated:** [September 2, 2024, 2:12pm UTC](https://discourse.julialang.org/t/type-stable-specializations-of-getproperty-without-code-duplication/92404 "2024-09-02T14:12:56Z")

</div>

I have a parametric type that I’m trying to specialize getproperty for. There are some properties which I’d like to always access independently of the type parameter, and there are some that only apply to specific type p…

---

## [Julia/JuMP efficiency comparison between different CPUs](https://discourse.julialang.org/t/julia-jump-efficiency-comparison-between-different-cpus/118920)

<div class="topic-metadata">

**Author:** [@Betristor](https://discourse.julialang.org/u/Betristor)\
**Replies:** 5\
**Last updated:** [September 2, 2024, 2:32am UTC](https://discourse.julialang.org/t/julia-jump-efficiency-comparison-between-different-cpus/118920 "2024-09-02T02:32:16Z")

</div>

What performance metrics of CPUs should we pay attention to since I noticed that for two kinds of CPUs, the modeling speed and memory consumption is totally different. For Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz, m…

---

## [V1.11-rc include("") will try to include the current folder](https://discourse.julialang.org/t/v1-11-rc-include-will-try-to-include-the-current-folder/118848)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 2\
**Last updated:** [August 31, 2024, 3:43pm UTC](https://discourse.julialang.org/t/v1-11-rc-include-will-try-to-include-the-current-folder/118848 "2024-08-31T15:43:50Z")

</div>

Hi there, I just stumbled upon the oddity that include("") was not doing anything in julia 1.10, but in 1.11 it tries to load the current folder (or something similar), which fails. Someone knows why this got changed?

---

## [Optimum use of Julia for two tasks](https://discourse.julialang.org/t/optimum-use-of-julia-for-two-tasks/118810)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 2\
**Last updated:** [August 30, 2024, 3:13pm UTC](https://discourse.julialang.org/t/optimum-use-of-julia-for-two-tasks/118810 "2024-08-30T15:13:07Z")

</div>

I have been working on an application that first collects data and then stores it to file. Then the file is read, processed and summary information stored in a database. The system is meant to operate continuously. fu…

---

## [Sharing precompiled code across docker images](https://discourse.julialang.org/t/sharing-precompiled-code-across-docker-images/68229)

<div class="topic-metadata">

**Author:** [@racinmat](https://discourse.julialang.org/u/racinmat)\
**Replies:** 5\
**Last updated:** [August 30, 2024, 11:21am UTC](https://discourse.julialang.org/t/sharing-precompiled-code-across-docker-images/68229 "2024-08-30T11:21:28Z")

</div>

I’m struggling with the precompilation time in julia inside docker image. We have some projects in julia in docker, and we’re doing changes quite often to this project, but the packages that take most time to precompile…

---

## [Julia 1.11 ignoring cache file ... since it does not provide desired build\_id](https://discourse.julialang.org/t/julia-1-11-ignoring-cache-file-since-it-does-not-provide-desired-build-id/118804)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 0\
**Last updated:** [August 30, 2024, 11:14am UTC](https://discourse.julialang.org/t/julia-1-11-ignoring-cache-file-since-it-does-not-provide-desired-build-id/118804 "2024-08-30T11:14:26Z")

</div>

I am trying to cache the .julia/compiled folder, and already switched to using v1.11 rc, but stumbled upon outputs similar to the following Debug: Ignoring cache file /home/jolin\_user/.julia/compiled/v1.11/Libgpg\_error…

---

## [How to concatenate matrices views without copying memory?](https://discourse.julialang.org/t/how-to-concatenate-matrices-views-without-copying-memory/118760)

<div class="topic-metadata">

**Author:** [@Blumenkranz](https://discourse.julialang.org/u/Blumenkranz)\
**Replies:** 3\
**Last updated:** [August 29, 2024, 1:08pm UTC](https://discourse.julialang.org/t/how-to-concatenate-matrices-views-without-copying-memory/118760 "2024-08-29T13:08:21Z")

</div>

Using vcat to catenate views leads to memory allocation which is contrary to the original intent of @views. CatViews.jl can address the issue to some extent, but it is only applicable to vectors. I wonder if there is a w…

---

## [Significantly different parameter estimates when using Static Array (MVector) as initial guess](https://discourse.julialang.org/t/significantly-different-parameter-estimates-when-using-static-array-mvector-as-initial-guess/118645)

<div class="topic-metadata">

**Author:** [@DylanEsguerra](https://discourse.julialang.org/u/DylanEsguerra)\
**Replies:** 5\
**Last updated:** [August 27, 2024, 5:19pm UTC](https://discourse.julialang.org/t/significantly-different-parameter-estimates-when-using-static-array-mvector-as-initial-guess/118645 "2024-08-27T17:19:41Z")

</div>

Hello I am ODE model fitting using autodiff with Optimization.jl and was looking to improve my code with the use of StaticArrays. The code runs slower than I hoped and has a lot of memory allocations (initially 4G befo…

---

## [@inbounds for getindex not working](https://discourse.julialang.org/t/inbounds-for-getindex-not-working/118631)

<div class="topic-metadata">

**Author:** [@Andy\_Zhang](https://discourse.julialang.org/u/Andy_Zhang)\
**Replies:** 2\
**Last updated:** [August 26, 2024, 4:24pm UTC](https://discourse.julialang.org/t/inbounds-for-getindex-not-working/118631 "2024-08-26T16:24:32Z")

</div>

Here is the example code and output. struct Minij{T\<:Number} \<: AbstractMatrix{T} n::Integer function Minij{T}(n::Integer) where {T\<:Number} n \>= 0 || throw(ArgumentError("$n \< 0")) return new{T…

---

## [Improving the performance of a spatial clustering model](https://discourse.julialang.org/t/improving-the-performance-of-a-spatial-clustering-model/118552)

<div class="topic-metadata">

**Author:** [@fmor](https://discourse.julialang.org/u/fmor)\
**Replies:** 8\
**Last updated:** [August 24, 2024, 5:48pm UTC](https://discourse.julialang.org/t/improving-the-performance-of-a-spatial-clustering-model/118552 "2024-08-24T17:48:36Z")

</div>

Hello, I am writing a statistical spatio-temporal model for clustering, using the target values Y\_{it} of the units, together with spatial coordinates {\\bf{s}}\_i and covariates {\\bf{x}}\_{it}. The choice of what to inclu…

---

## [Matrix of SVectors allocating](https://discourse.julialang.org/t/matrix-of-svectors-allocating/117670)

<div class="topic-metadata">

**Author:** [@vincentxwang](https://discourse.julialang.org/u/vincentxwang)\
**Replies:** 7\
**Last updated:** [August 2, 2024, 7:56pm UTC](https://discourse.julialang.org/t/matrix-of-svectors-allocating/117670 "2024-08-02T19:56:58Z")

</div>

Hi, I’m trying to multiply a matrix of Float64 by a matrix of SVectors, but I’m finding that mul! will take a while to allocate some memory for this, and I’m not sure why. Is there some way to get around this? using St…

---

## [Tell the compiler the return type of function chosen at runtime](https://discourse.julialang.org/t/tell-the-compiler-the-return-type-of-function-chosen-at-runtime/118429)

<div class="topic-metadata">

**Author:** [@ljg](https://discourse.julialang.org/u/ljg)\
**Replies:** 3\
**Last updated:** [August 21, 2024, 7:10am UTC](https://discourse.julialang.org/t/tell-the-compiler-the-return-type-of-function-chosen-at-runtime/118429 "2024-08-21T07:10:52Z")

</div>

The following MRE function: function fun(idx, a::Int, b::Int) funs = \[+, -\] return funs\[idx\](a, b) end Is not type-stable because Julia does not infer the return type of funs\[idx\]. Here is the output of @code\_…

---

## [Performance vs notation tradeoff: DataFrame vs AxisArray vs StaticArray vs?](https://discourse.julialang.org/t/performance-vs-notation-tradeoff-dataframe-vs-axisarray-vs-staticarray-vs/118323)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 2\
**Last updated:** [August 20, 2024, 4:47pm UTC](https://discourse.julialang.org/t/performance-vs-notation-tradeoff-dataframe-vs-axisarray-vs-staticarray-vs/118323 "2024-08-20T16:47:33Z")

</div>

I’ve got two datasets that would look like this in a dataframe (see later for MWE): julia\> df1 = mat2df(mat1, colnames1, id1) 8×5 DataFrame Row │ id col1 col2 col3 col4 │ String Int64 Int64 Int64 …

---

## [NeuralOperators.jl Performance (compared with Python)](https://discourse.julialang.org/t/neuraloperators-jl-performance-compared-with-python/106076)

<div class="topic-metadata">

**Author:** [@Julian\_Villaquira](https://discourse.julialang.org/u/Julian_Villaquira)\
**Replies:** 8\
**Last updated:** [August 20, 2024, 3:35am UTC](https://discourse.julialang.org/t/neuraloperators-jl-performance-compared-with-python/106076 "2024-08-20T03:35:59Z")

</div>

Hi, I am training a Neural Operator to learn a map between a two dimensional domain. For Julia, this is a MWE of the problem I am considering: # Imports. using NeuralOperators using Flux using FluxTraining using MLUtils…

---

## [Best way to calculate B' \* A \* B](https://discourse.julialang.org/t/best-way-to-calculate-b-a-b/118382)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 1\
**Last updated:** [August 19, 2024, 7:09pm UTC](https://discourse.julialang.org/t/best-way-to-calculate-b-a-b/118382 "2024-08-19T19:09:22Z")

</div>

I’d like to calculate B' \* A \* B, where A is Hermitian, without allocating intermediary results. Note that B will be, in general, a rectangular matrix. I’m currently using Tullio to do the calculation, but I was wonderin…

---

## [Julia performance on the same task on different CPUs and OSs](https://discourse.julialang.org/t/julia-performance-on-the-same-task-on-different-cpus-and-oss/117916)

<div class="topic-metadata">

**Author:** [@kobusherbst](https://discourse.julialang.org/u/kobusherbst)\
**Replies:** 8\
**Last updated:** [August 18, 2024, 4:57am UTC](https://discourse.julialang.org/t/julia-performance-on-the-same-task-on-different-cpus-and-oss/117916 "2024-08-18T04:57:22Z")

</div>

The workload Arrow files with 250K individuals and 3M education status observations Read into memory as DataFrames, join individual records with education status observations. Group resulting data frame by individual a…

---

## [Most efficient way to obtain the decimal representation of a rational number?](https://discourse.julialang.org/t/most-efficient-way-to-obtain-the-decimal-representation-of-a-rational-number/118303)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 12\
**Last updated:** [August 17, 2024, 11:08pm UTC](https://discourse.julialang.org/t/most-efficient-way-to-obtain-the-decimal-representation-of-a-rational-number/118303 "2024-08-17T23:08:09Z")

</div>

Let’s say I want to obtain the decimal representation of p//q e.g. 1/2 is 0.5 so I would store that as (\[0, 5\], 2) where the 2nd value in the tuple is the position where the digits don’t repeat. And so 1//7 = 0.142857 t…

---

## [Compare data from two dataframes](https://discourse.julialang.org/t/compare-data-from-two-dataframes/118254)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 3\
**Last updated:** [August 17, 2024, 1:57pm UTC](https://discourse.julialang.org/t/compare-data-from-two-dataframes/118254 "2024-08-17T13:57:45Z")

</div>

I have two dataframes as shown below and I need to create csv file or json output like shown below. I need to get dominant row for each product for each date from two dataframes then compare them to generate below outpu…

---

## [How to fix ambiguities found through Aqua.jl?](https://discourse.julialang.org/t/how-to-fix-ambiguities-found-through-aqua-jl/118269)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 4\
**Last updated:** [August 16, 2024, 1:03pm UTC](https://discourse.julialang.org/t/how-to-fix-ambiguities-found-through-aqua-jl/118269 "2024-08-16T13:03:24Z")

</div>

Hello! I am using Aqua to find ambiguities in my package (GitHub - AhmedSalih3d/SPHExample: Simple SPH dam-break simulation in Julia) and the following ones have been found: julia\> @testset "aqua test ambiguities" begi…

---

## [Unexpectedly slow performance of iszero for BitVector](https://discourse.julialang.org/t/unexpectedly-slow-performance-of-iszero-for-bitvector/118238)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 8\
**Last updated:** [August 16, 2024, 11:16am UTC](https://discourse.julialang.org/t/unexpectedly-slow-performance-of-iszero-for-bitvector/118238 "2024-08-16T11:16:19Z")

</div>

The builtin function iszero for BitVector seems unreasonably slow: julia\> a = BitVector(fill(0,10000)); julia\> @benchmark iszero($a) BenchmarkTools.Trial: 10000 samples with 8 evaluations. Range (min … max): 3.750 μs…

---

## [Fastest way to read fixed-width tables embedded in a larger text file](https://discourse.julialang.org/t/fastest-way-to-read-fixed-width-tables-embedded-in-a-larger-text-file/118108)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 9\
**Last updated:** [August 14, 2024, 11:11pm UTC](https://discourse.julialang.org/t/fastest-way-to-read-fixed-width-tables-embedded-in-a-larger-text-file/118108 "2024-08-14T23:11:36Z")

</div>

I’ve got a bunch of .txt files that contain a few hundred lines of “junk” at the beginning, then two tables embedded at the end. Those two tables always begin the same number of lines from the end of the file. Further, t…

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

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