# Performance

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

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

**Page:** 95

---

## [What is the cause of this performance difference between Julia and Cython?](https://discourse.julialang.org/t/what-is-the-cause-of-this-performance-difference-between-julia-and-cython/58886)

<div class="topic-metadata">

**Author:** [@smpurkis](https://discourse.julialang.org/u/smpurkis)\
**Replies:** 9\
**Last updated:** [April 19, 2021, 6:47pm UTC](https://discourse.julialang.org/t/what-is-the-cause-of-this-performance-difference-between-julia-and-cython/58886 "2021-04-19T18:47:36Z")

</div>

Hello all, I’m fairly new to Julia. I have a simple array function I’m using for comparing the speed of different languages. In this case Julia and Cython (subset of Python). The function in Julia is: function comput…

---

## [Different outcomes with the same function](https://discourse.julialang.org/t/different-outcomes-with-the-same-function/59570)

<div class="topic-metadata">

**Author:** [@valperez](https://discourse.julialang.org/u/valperez)\
**Replies:** 1\
**Last updated:** [April 19, 2021, 6:24pm UTC](https://discourse.julialang.org/t/different-outcomes-with-the-same-function/59570 "2021-04-19T18:24:40Z")

</div>

Hi, I’m making a program in Julia that calculates the posteriori distribution of a beta binomial model. My first model was the following: @model betabinomial(n, z, x, y, delta, gamma) = begin alpha\_p ~ truncated(Norma…

---

## [Fast Distance Histograms](https://discourse.julialang.org/t/fast-distance-histograms/59439)

<div class="topic-metadata">

**Author:** [@JAgho](https://discourse.julialang.org/u/JAgho)\
**Replies:** 6\
**Last updated:** [April 19, 2021, 4:08pm UTC](https://discourse.julialang.org/t/fast-distance-histograms/59439 "2021-04-19T16:08:06Z")

</div>

I’m writing distance histograms in Julia, and I think I’ve hit a limit in the performance of my serial code. The problem is pretty simple - given a list of vectors (positions), compute the distance (euclidian) between al…

---

## [Understanding the performance issue in combine() \[DataFrames.jl\]](https://discourse.julialang.org/t/understanding-the-performance-issue-in-combine-dataframes-jl/59531)

<div class="topic-metadata">

**Author:** [@DataFrames](https://discourse.julialang.org/u/DataFrames)\
**Replies:** 1\
**Last updated:** [April 18, 2021, 12:53pm UTC](https://discourse.julialang.org/t/understanding-the-performance-issue-in-combine-dataframes-jl/59531 "2021-04-18T12:53:00Z")

</div>

I have the following performance issue with user defined function in combine(). Assume df = DataFrame(g = rand(1:100,1000), x = rand(1000)) and temp\_fun(x) = sum(x) the performance of combine() in the following two s…

---

## [Question about Multiple prediction](https://discourse.julialang.org/t/question-about-multiple-prediction/59527)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 0\
**Last updated:** [April 18, 2021, 8:18am UTC](https://discourse.julialang.org/t/question-about-multiple-prediction/59527 "2021-04-18T08:18:14Z")

</div>

I am working on the forecasting of power system operation mode.This is a prediction problem with multiple input and multiple output variables coupled to each other,Is there a recommended algorithm or Pkg? thank you !!!

---

## [Julia is Eight times Slower than Go on Numerical Scheme](https://discourse.julialang.org/t/julia-is-eight-times-slower-than-go-on-numerical-scheme/59383)

<div class="topic-metadata">

**Author:** [@ejolson](https://discourse.julialang.org/u/ejolson)\
**Replies:** 31\
**Last updated:** [April 17, 2021, 5:29pm UTC](https://discourse.julialang.org/t/julia-is-eight-times-slower-than-go-on-numerical-scheme/59383 "2021-04-17T17:29:47Z")

</div>

Here is a run of the Julia code conjulia -- Energy Conserving IRK Scheme y(0)=\[1.0, 1.0, 1.0\] p n h E(100) dE(100) error 7 128 7.8125000e-01 3.0000000e+00 0.00…

---

## [True power set of a set is slower than power array of array](https://discourse.julialang.org/t/true-power-set-of-a-set-is-slower-than-power-array-of-array/59464)

<div class="topic-metadata">

**Author:** [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Replies:** 3\
**Last updated:** [April 17, 2021, 4:34pm UTC](https://discourse.julialang.org/t/true-power-set-of-a-set-is-slower-than-power-array-of-array/59464 "2021-04-17T16:34:49Z")

</div>

I’m trying to create a power set function with only set operations, but it turns out to be much slower than the array version. I wonder why this is the case, and how to make the Set version as fast as the array version. …

---

## [Faster groupwise joins to complete implicitly missing rows](https://discourse.julialang.org/t/faster-groupwise-joins-to-complete-implicitly-missing-rows/59414)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 2\
**Last updated:** [April 16, 2021, 9:05pm UTC](https://discourse.julialang.org/t/faster-groupwise-joins-to-complete-implicitly-missing-rows/59414 "2021-04-16T21:05:53Z")

</div>

I have a grouped DataFrame with dates and values but only observe dates in which a value was observed. I’d like to create the rows that are implicitly missing and have them as missing e.g. for interpolation later. I came…

---

## [Differences between mutliple functions and function with multiple methods](https://discourse.julialang.org/t/differences-between-mutliple-functions-and-function-with-multiple-methods/59317)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 9\
**Last updated:** [April 16, 2021, 4:01pm UTC](https://discourse.julialang.org/t/differences-between-mutliple-functions-and-function-with-multiple-methods/59317 "2021-04-16T16:01:50Z")

</div>

For one of my projects, I have multiple implementations of the same analytical computations. These implementations offer different speed / precision trade-offs, and involve mostly a two step process where the entries and…

---

## [Does @allocated not work with multithreading?](https://discourse.julialang.org/t/does-allocated-not-work-with-multithreading/59354)

<div class="topic-metadata">

**Author:** [@nmayhall-vt](https://discourse.julialang.org/u/nmayhall-vt)\
**Replies:** 3\
**Last updated:** [April 16, 2021, 5:12am UTC](https://discourse.julialang.org/t/does-allocated-not-work-with-multithreading/59354 "2021-04-16T05:12:38Z")

</div>

I’ve been trying to better undertstand how to find allocations in my code, and I stumbled on this simple MWE which either exposes some limitation of @allocated, or (more likely) a limitation of my understanding. functio…

---

## [Performance difference between optional args and keyword args](https://discourse.julialang.org/t/performance-difference-between-optional-args-and-keyword-args/59272)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 8\
**Last updated:** [April 15, 2021, 2:26pm UTC](https://discourse.julialang.org/t/performance-difference-between-optional-args-and-keyword-args/59272 "2021-04-15T14:26:30Z")

</div>

Is there any (theoretical) difference in performance between functions defined with optional arguments and functions defined with keyword arguments? The manual says: Keyword arguments behave quite differently from ordi…

---

## [Softmax applied to arrays?](https://discourse.julialang.org/t/softmax-applied-to-arrays/59299)

<div class="topic-metadata">

**Author:** [@dadada\_dadada](https://discourse.julialang.org/u/dadada_dadada)\
**Replies:** 2\
**Last updated:** [April 14, 2021, 9:56pm UTC](https://discourse.julialang.org/t/softmax-applied-to-arrays/59299 "2021-04-14T21:56:01Z")

</div>

Hi everybody, I would like to repeatedly apply (a variation of) the softmax function to parts of an array. I would like to know if there are ways to leverage packages like Tullio, Yeppp, and other Julianic features as …

---

## [The REPL and character display](https://discourse.julialang.org/t/the-repl-and-character-display/59269)

<div class="topic-metadata">

**Author:** [@Hermes](https://discourse.julialang.org/u/Hermes)\
**Replies:** 5\
**Last updated:** [April 14, 2021, 7:23pm UTC](https://discourse.julialang.org/t/the-repl-and-character-display/59269 "2021-04-14T19:23:09Z")

</div>

What should I install so that in Julia REPL, symbols and special characters can be correctly seen. In the figure I show what happens: However in VS Code Terminal, the characters and symbols are correctly seen jul…

---

## [Maximizing an objective function with many logs](https://discourse.julialang.org/t/maximizing-an-objective-function-with-many-logs/59227)

<div class="topic-metadata">

**Author:** [@dadada\_dadada](https://discourse.julialang.org/u/dadada_dadada)\
**Replies:** 6\
**Last updated:** [April 14, 2021, 2:21am UTC](https://discourse.julialang.org/t/maximizing-an-objective-function-with-many-logs/59227 "2021-04-14T02:21:34Z")

</div>

Hi, I have a conceptually simple objective function (an MLE estimator) that has a lot of logs. This kind of objective function is very common in Statistics and Economics. For example, consider the following objective f…

---

## [Performance difference when accessing square matrix rows-first or cols-first](https://discourse.julialang.org/t/performance-difference-when-accessing-square-matrix-rows-first-or-cols-first/59188)

<div class="topic-metadata">

**Author:** [@danilo-bc](https://discourse.julialang.org/u/danilo-bc)\
**Replies:** 14\
**Last updated:** [April 13, 2021, 8:32pm UTC](https://discourse.julialang.org/t/performance-difference-when-accessing-square-matrix-rows-first-or-cols-first/59188 "2021-04-13T20:32:19Z")

</div>

I’m trying to expose a few Julia basics for friends, specially performance results, so I’m creating code snippets for visualization. In this example, I have two functions creating matrices of zeros and I’m simply settin…

---

## [Simple multi-thread loop with array](https://discourse.julialang.org/t/simple-multi-thread-loop-with-array/59117)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 11\
**Last updated:** [April 13, 2021, 6:09pm UTC](https://discourse.julialang.org/t/simple-multi-thread-loop-with-array/59117 "2021-04-13T18:09:01Z")

</div>

Hello! I am struggling with how @threads works. I believe I understand what it does but I don’t get the expected result in the following MWE: struct MyStr arr::Array{Int,1} end function MyStr(N::Int) return MyS…

---

## [Change number of workers in make](https://discourse.julialang.org/t/change-number-of-workers-in-make/59177)

<div class="topic-metadata">

**Author:** [@puerco-errante](https://discourse.julialang.org/u/puerco-errante)\
**Replies:** 3\
**Last updated:** [April 13, 2021, 1:40pm UTC](https://discourse.julialang.org/t/change-number-of-workers-in-make/59177 "2021-04-13T13:40:52Z")

</div>

Hi! I’m sorry if this is a very noob question, but I’m not very experienced with make files and I couldn’t find anything in google to help me out. I want to make test but the makefile launches all 8 workers and it ends…

---

## [Why is work with Q in qr() is so expensive?](https://discourse.julialang.org/t/why-is-work-with-q-in-qr-is-so-expensive/59143)

<div class="topic-metadata">

**Author:** [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Replies:** 6\
**Last updated:** [April 13, 2021, 9:33am UTC](https://discourse.julialang.org/t/why-is-work-with-q-in-qr-is-so-expensive/59143 "2021-04-13T09:33:42Z")

</div>

In the picture below, we can see that it is very efficient to generate a random unitary matrix Q using the qr() function in LinearAlgebra. However, if we want to work with the generated Q, it appears to be very expensiv…

---

## [Solution concept for "world age" problem occuring with @generated and macros](https://discourse.julialang.org/t/solution-concept-for-world-age-problem-occuring-with-generated-and-macros/57408)

<div class="topic-metadata">

**Author:** [@rryi](https://discourse.julialang.org/u/rryi)\
**Replies:** 7\
**Last updated:** [April 12, 2021, 7:37pm UTC](https://discourse.julialang.org/t/solution-concept-for-world-age-problem-occuring-with-generated-and-macros/57408 "2021-04-12T19:37:38Z")

</div>

This is not a beginner’s question, it is a question to advanced julia users whether my concept below is a valid and generalizable approach. And if the answers turn out to be positive, it might help others to overcome …

---

## [Why is this simple function twice as slow as its Python version](https://discourse.julialang.org/t/why-is-this-simple-function-twice-as-slow-as-its-python-version/59004)

<div class="topic-metadata">

**Author:** [@Semi](https://discourse.julialang.org/u/Semi)\
**Replies:** 97\
**Last updated:** [April 12, 2021, 3:23pm UTC](https://discourse.julialang.org/t/why-is-this-simple-function-twice-as-slow-as-its-python-version/59004 "2021-04-12T15:23:04Z")

</div>

I’m in the planing stages for writing a piece of scientific software and I would like to use Julia for it, but I’m surprised how much slower Julia is from Python when tested on this simple code: function test(n::Int64,k…

---

## [Turning Expressions into Functions](https://discourse.julialang.org/t/turning-expressions-into-functions/49558)

<div class="topic-metadata">

**Author:** [@1ozturkbe](https://discourse.julialang.org/u/1ozturkbe)\
**Replies:** 17\
**Last updated:** [April 12, 2021, 12:41pm UTC](https://discourse.julialang.org/t/turning-expressions-into-functions/49558 "2021-04-12T12:41:16Z")

</div>

I have the following Expression: ex = :(sum(x\[i\] for i=1:4)- y\[1\] \* y\[2\] + z) which I would like to evaluate over some data x, y, z. I have tried doing direct substitution through symbolic manipulations, but it is abys…

---

## [Calling a simple method with unused type parameters unexpectedly allocates memory](https://discourse.julialang.org/t/calling-a-simple-method-with-unused-type-parameters-unexpectedly-allocates-memory/59050)

<div class="topic-metadata">

**Author:** [@aciobanas](https://discourse.julialang.org/u/aciobanas)\
**Replies:** 5\
**Last updated:** [April 12, 2021, 11:03am UTC](https://discourse.julialang.org/t/calling-a-simple-method-with-unused-type-parameters-unexpectedly-allocates-memory/59050 "2021-04-12T11:03:00Z")

</div>

Hello, I am trying to understand why the calling of a relatively simple method with unused type parameters allocates memory, while the same method with no type parameters does not. I have a method that is aiming at com…

---

## [Efficient parallelization of in place transforms](https://discourse.julialang.org/t/efficient-parallelization-of-in-place-transforms/59062)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 1\
**Last updated:** [April 12, 2021, 4:50am UTC](https://discourse.julialang.org/t/efficient-parallelization-of-in-place-transforms/59062 "2021-04-12T04:50:22Z")

</div>

I wanted to revisit this discussion from Pmap with in place functions that I started 2 years ago. Generalizing a bit, suppose I have an in place transform f!(x) and array of data, xvals, on which I want to apply the tra…

---

## [Avoid ambiguous function type allocation without losing abstract type](https://discourse.julialang.org/t/avoid-ambiguous-function-type-allocation-without-losing-abstract-type/59040)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 5\
**Last updated:** [April 11, 2021, 7:08pm UTC](https://discourse.julialang.org/t/avoid-ambiguous-function-type-allocation-without-losing-abstract-type/59040 "2021-04-11T19:08:00Z")

</div>

I’m using a multiple dispatch on an abstract type (AbstractBody) to switch between two behaviours. I need to store a performance critical function in one case, but don’t need to store anything in the other case. I’ve im…

---

## [Why is the function evaluation with more allocations faster?](https://discourse.julialang.org/t/why-is-the-function-evaluation-with-more-allocations-faster/58934)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 6\
**Last updated:** [April 11, 2021, 7:24am UTC](https://discourse.julialang.org/t/why-is-the-function-evaluation-with-more-allocations-faster/58934 "2021-04-11T07:24:16Z")

</div>

I have a pretty basic question - I’m evaluating some function over an array of inputs. @inline function f(x) y = @. log(x) return @. exp(y) end This results in extra allocations, and I thought avoiding allocations wou…

---

## [Optimizing Linear Algebra Code?](https://discourse.julialang.org/t/optimizing-linear-algebra-code/58797)

<div class="topic-metadata">

**Author:** [@loki](https://discourse.julialang.org/u/loki)\
**Replies:** 12\
**Last updated:** [April 9, 2021, 9:16pm UTC](https://discourse.julialang.org/t/optimizing-linear-algebra-code/58797 "2021-04-09T21:16:34Z")

</div>

Hello everyone! I’ve been trying to convert some simple functions that were originally implemented in Matlab into Julia. They revolve around vector/matrix and matrix/matrix multiplication. My question stems from trying …

---

## [Initialization of vector of matrix decompositions](https://discourse.julialang.org/t/initialization-of-vector-of-matrix-decompositions/58909)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 4\
**Last updated:** [April 9, 2021, 2:08pm UTC](https://discourse.julialang.org/t/initialization-of-vector-of-matrix-decompositions/58909 "2021-04-09T14:08:19Z")

</div>

For one of my projects, I need to perform multiple QR (up to multiple hundreds) decompositions of dense tall complex matrices. These decompositions are later used in some linear algebra operations, where the operations a…

---

## [Optimizing E-Graphs pattern matcher: a complicated problem](https://discourse.julialang.org/t/optimizing-e-graphs-pattern-matcher-a-complicated-problem/58914)

<div class="topic-metadata">

**Author:** [@0x0f0f0f](https://discourse.julialang.org/u/0x0f0f0f)\
**Replies:** 0\
**Last updated:** [April 9, 2021, 11:13am UTC](https://discourse.julialang.org/t/optimizing-e-graphs-pattern-matcher-a-complicated-problem/58914 "2021-04-09T11:13:44Z")

</div>

With Metatheory.jl, I have a big performance problem when pattern matching against egraphs, a fairly complex algorithm and data structure https://github.com/0x0f0f0f/Metatheory.jl/issues/6 If anyone is skilled enough o…

---

## [Does the Profile package report system time?](https://discourse.julialang.org/t/does-the-profile-package-report-system-time/58911)

<div class="topic-metadata">

**Author:** [@mroavi](https://discourse.julialang.org/u/mroavi)\
**Replies:** 0\
**Last updated:** [April 9, 2021, 10:02am UTC](https://discourse.julialang.org/t/does-the-profile-package-report-system-time/58911 "2021-04-09T10:02:27Z")

</div>

Does the Profile package indicate the relative time the system spends allocating and freeing memory on the heap? Or is this information not included in the profile at all? (edited)

---

## [Question about program design with ComponentArrays](https://discourse.julialang.org/t/question-about-program-design-with-componentarrays/58732)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 5\
**Last updated:** [April 8, 2021, 11:42am UTC](https://discourse.julialang.org/t/question-about-program-design-with-componentarrays/58732 "2021-04-08T11:42:25Z")

</div>

I’m retaking a program I did some time ago, trying to speed it up. I am using ComponentArrays because it is very easy to organize data and parameters with it. Consider this: using ComponentArrays using Parameters: @unpa…

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

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