# Performance

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

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

**Page:** 100

---

## [Julia.exe (portable 64 bit nightly and 1.6 rc) are infected?](https://discourse.julialang.org/t/julia-exe-portable-64-bit-nightly-and-1-6-rc-are-infected/55757)

<div class="topic-metadata">

**Author:** [@Humphrey\_Lee](https://discourse.julialang.org/u/Humphrey_Lee)\
**Replies:** 8\
**Last updated:** [February 22, 2021, 4:44am UTC](https://discourse.julialang.org/t/julia-exe-portable-64-bit-nightly-and-1-6-rc-are-infected/55757 "2021-02-22T04:44:10Z")

</div>

Tried couple downloads and running the julia.exe (1.6.0 rc and nightly - portable 64 bit versions) downloaded from julialang.org. Each time, the Symantec on my system (Win10) caught it with SONAR.Dropper (Trojan?). Pleas…

---

## [First try seems a bit sluggish](https://discourse.julialang.org/t/first-try-seems-a-bit-sluggish/55741)

<div class="topic-metadata">

**Author:** [@FaradayEnt](https://discourse.julialang.org/u/FaradayEnt)\
**Replies:** 5\
**Last updated:** [February 21, 2021, 11:58pm UTC](https://discourse.julialang.org/t/first-try-seems-a-bit-sluggish/55741 "2021-02-21T23:58:26Z")

</div>

I’m an old ‘C’ programmer, but total NB here, so guess I’m doing something wrong. Would like to write an application requiring CSV file I/O so found the following sample code. I’m on Win 7, using 64 bit julia-1.5.3 dow…

---

## [How to avoid allocations when multiplying numbers with missings](https://discourse.julialang.org/t/how-to-avoid-allocations-when-multiplying-numbers-with-missings/55393)

<div class="topic-metadata">

**Author:** [@bgctw](https://discourse.julialang.org/u/bgctw)\
**Replies:** 15\
**Last updated:** [February 20, 2021, 3:50pm UTC](https://discourse.julialang.org/t/how-to-avoid-allocations-when-multiplying-numbers-with-missings/55393 "2021-02-20T15:50:27Z")

</div>

Coming from R I have a hard time to use missings and ensure type stability. I guess that the following allocations in multiplication of numbers also relate to this issue. How can I avoid the memory allocations in the fo…

---

## [Type stability on Arrays of Arrays in nested for loops?](https://discourse.julialang.org/t/type-stability-on-arrays-of-arrays-in-nested-for-loops/55619)

<div class="topic-metadata">

**Author:** [@swishmas](https://discourse.julialang.org/u/swishmas)\
**Replies:** 16\
**Last updated:** [February 20, 2021, 12:01am UTC](https://discourse.julialang.org/t/type-stability-on-arrays-of-arrays-in-nested-for-loops/55619 "2021-02-20T00:01:52Z")

</div>

I was writing a function that would ideally be written as function ideal(supervec::Array{Array{Int64,1},1}, vec::Array{Int64,1}) return vcat(supervec\[vec\]) end But this takes a bit more time than I think is unn…

---

## [Peformance Benckmark of HTTP.jl](https://discourse.julialang.org/t/peformance-benckmark-of-http-jl/55642)

<div class="topic-metadata">

**Author:** [@DataPsycho](https://discourse.julialang.org/u/DataPsycho)\
**Replies:** 1\
**Last updated:** [February 19, 2021, 7:13pm UTC](https://discourse.julialang.org/t/peformance-benckmark-of-http-jl/55642 "2021-02-19T19:13:21Z")

</div>

Hi, Does any one one have a proper performance bench mark of HTTP.jl . I have build same service in 3 different framework GinTonic-GO, HTTP.jl - Julia, Flask-Restful - Python. I though I will get a lot better performanc…

---

## [Speeding Up Function with ::Function and ::Vararg input](https://discourse.julialang.org/t/speeding-up-function-with-function-and-vararg-input/55551)

<div class="topic-metadata">

**Author:** [@markmbaum](https://discourse.julialang.org/u/markmbaum)\
**Replies:** 17\
**Last updated:** [February 19, 2021, 5:51pm UTC](https://discourse.julialang.org/t/speeding-up-function-with-function-and-vararg-input/55551 "2021-02-19T17:51:47Z")

</div>

I need help understanding how/if I can speed up a function that has a ::Function argument and a ::Vararg argument. I have several functions that do almost the same thing. They each receive a few vector arguments, calcul…

---

## [Creating function that broadcast function over multiple keyword arguments](https://discourse.julialang.org/t/creating-function-that-broadcast-function-over-multiple-keyword-arguments/55491)

<div class="topic-metadata">

**Author:** [@matnbo](https://discourse.julialang.org/u/matnbo)\
**Replies:** 7\
**Last updated:** [February 18, 2021, 10:15am UTC](https://discourse.julialang.org/t/creating-function-that-broadcast-function-over-multiple-keyword-arguments/55491 "2021-02-18T10:15:11Z")

</div>

Dear all I come from the R community, and try to switch to Julia ) Assume I have a function f1 (fictive function below) f1 = function(x, y ; a = 1.5, b = 5) coef = a \* sum(x’y) + b (coef = coef, mod = 1) end whe…

---

## [Too many allocations?](https://discourse.julialang.org/t/too-many-allocations/55478)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 23\
**Last updated:** [February 18, 2021, 9:06am UTC](https://discourse.julialang.org/t/too-many-allocations/55478 "2021-02-18T09:06:28Z")

</div>

I’m thinking about optimizing performance and my mind initially goes to reducing the number of allocations. Below is a function with a loop that executes ~ 1,000,000 times. When I “time” the routine, I find that it exe…

---

## [Vectorized math](https://discourse.julialang.org/t/vectorized-math/55476)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 12\
**Last updated:** [February 17, 2021, 8:02pm UTC](https://discourse.julialang.org/t/vectorized-math/55476 "2021-02-17T20:02:28Z")

</div>

Is there a need to use the “.” for vector math when adding and multiplying? a = \[1 2 3\] b = \[3 4 5\] # Which is better for performance? They both do the same thing. c = 1/2 \* a + b d = 1/2 .\* a .+ b

---

## [Efficient reflection on structs](https://discourse.julialang.org/t/efficient-reflection-on-structs/55278)

<div class="topic-metadata">

**Author:** [@Guillaume\_Leclerc](https://discourse.julialang.org/u/Guillaume_Leclerc)\
**Replies:** 54\
**Last updated:** [February 17, 2021, 6:08pm UTC](https://discourse.julialang.org/t/efficient-reflection-on-structs/55278 "2021-02-17T18:08:43Z")

</div>

Hello, I am trying to do something to StructArray but I can’t seem to generate efficient code. Let’s say there is struct Wrapper{T} and it is supposed to behave similarly to T except I’m managing where/how the underlyi…

---

## [Help Improving Performance of a Loop](https://discourse.julialang.org/t/help-improving-performance-of-a-loop/55343)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 15\
**Last updated:** [February 16, 2021, 1:01pm UTC](https://discourse.julialang.org/t/help-improving-performance-of-a-loop/55343 "2021-02-16T13:01:21Z")

</div>

Hello! I am trying to make a code more efficient and I have found a huge bottleneck in the following function of this MWE: using Random, BenchmarkTools J = 250 T = 100 Mat1 = rand(J,J) vec1 = rand(J) Mat2= rand(J,J…

---

## [Define methods for packages without importing](https://discourse.julialang.org/t/define-methods-for-packages-without-importing/55353)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 1\
**Last updated:** [February 15, 2021, 10:01pm UTC](https://discourse.julialang.org/t/define-methods-for-packages-without-importing/55353 "2021-02-15T22:01:19Z")

</div>

Say that I got a package Foo and want my package to include some methods especially for handling DataFrames, and plots from Plots and Gadfly. To do this, I could define something like module Foo import DataFrames impo…

---

## [Best way to extract parts of arrays in a bigger array](https://discourse.julialang.org/t/best-way-to-extract-parts-of-arrays-in-a-bigger-array/55274)

<div class="topic-metadata">

**Author:** [@stebett](https://discourse.julialang.org/u/stebett)\
**Replies:** 2\
**Last updated:** [February 15, 2021, 8:38am UTC](https://discourse.julialang.org/t/best-way-to-extract-parts-of-arrays-in-a-bigger-array/55274 "2021-02-15T08:38:41Z")

</div>

Hello everyone, I’m wondering if anybody can find a better solution to this problem: I have 2 arrays of arrays: in the first one there are time series, and in the second one there are timepoints on those time series. M…

---

## [Large idle memory usage](https://discourse.julialang.org/t/large-idle-memory-usage/20368)

<div class="topic-metadata">

**Author:** [@NS1](https://discourse.julialang.org/u/NS1)\
**Replies:** 6\
**Last updated:** [February 14, 2021, 7:56pm UTC](https://discourse.julialang.org/t/large-idle-memory-usage/20368 "2021-02-14T19:56:03Z")

</div>

Hi, I found that Julia has quite a large memory footprint in my machine, and wanted to ask if it’s normal. By opening Atom, a Julia process opens, with ~500 MB. When starting julia in the REPL, another process with sim…

---

## [Update on single dispatch benchmark comparison to C++](https://discourse.julialang.org/t/update-on-single-dispatch-benchmark-comparison-to-c/7283)

<div class="topic-metadata">

**Author:** [@cdsousa](https://discourse.julialang.org/u/cdsousa)\
**Replies:** 19\
**Last updated:** [February 13, 2021, 5:47pm UTC](https://discourse.julialang.org/t/update-on-single-dispatch-benchmark-comparison-to-c/7283 "2021-02-13T17:47:39Z")

</div>

Hi, I’m making an update of the benchmarks I had ran back in 2015, comparing the performance of Julia dispatch on single argument against C++ dispatch: Redirecting to Google Groups The code is in here: https://github.c…

---

## [Why is SVector faster than MVector](https://discourse.julialang.org/t/why-is-svector-faster-than-mvector/55174)

<div class="topic-metadata">

**Author:** [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Replies:** 13\
**Last updated:** [February 13, 2021, 4:07pm UTC](https://discourse.julialang.org/t/why-is-svector-faster-than-mvector/55174 "2021-02-13T16:07:34Z")

</div>

Why are these nearly identical function not compiled into the same llvm ir? using StaticArrays using BenchmarkTools function funcS() ret = SVector(0,0) ret = ret + SVector(123, 321) return ret end function f…

---

## [Vector local to loop iteration vs. Static Vector](https://discourse.julialang.org/t/vector-local-to-loop-iteration-vs-static-vector/55109)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [February 12, 2021, 7:41pm UTC](https://discourse.julialang.org/t/vector-local-to-loop-iteration-vs-static-vector/55109 "2021-02-12T19:41:41Z")

</div>

In simple the example below, I write two functions that compute “the force” between the particles of a set. To compute the forces between each pair of particles one needs to compute the difference in position of the two …

---

## [@everything copy absolutely everything in main process](https://discourse.julialang.org/t/everything-copy-absolutely-everything-in-main-process/55159)

<div class="topic-metadata">

**Author:** [@s-baumann](https://discourse.julialang.org/u/s-baumann)\
**Replies:** 4\
**Last updated:** [February 12, 2021, 6:08pm UTC](https://discourse.julialang.org/t/everything-copy-absolutely-everything-in-main-process/55159 "2021-02-12T18:08:52Z")

</div>

I have a long script that has alot of functions defined and packages included. Then there is a big for loop at the end I want to parallelise. For a minimal example: using Distributed Distributed.addprocs(4) @everywhere …

---

## [What is the fastest way to perform unary operation inplace?](https://discourse.julialang.org/t/what-is-the-fastest-way-to-perform-unary-operation-inplace/55139)

<div class="topic-metadata">

**Author:** [@encendre](https://discourse.julialang.org/u/encendre)\
**Replies:** 1\
**Last updated:** [February 12, 2021, 11:09am UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-to-perform-unary-operation-inplace/55139 "2021-02-12T11:09:16Z")

</div>

What is the fastest way to perform unary operation inplace ? I have tried the followings b = rand(1000000) @time b = -b # 0.011017 seconds (2 allocations: 7.629 MiB) @time b = (-).(b) # 0.012952 seconds (2 allocatio…

---

## [Slurm doesn't like @spawnat :any](https://discourse.julialang.org/t/slurm-doesnt-like-spawnat-any/55112)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 3\
**Last updated:** [February 12, 2021, 6:30am UTC](https://discourse.julialang.org/t/slurm-doesnt-like-spawnat-any/55112 "2021-02-12T06:30:09Z")

</div>

I don’t really have an MWE for this. It never fails on the desktop (10 workers), but when it runs on hpc (single node 40 workers) I get really messy errors. I have plenty of distributed for loops in other sections of t…

---

## [Faster conversion to CategoricalArray with many groups](https://discourse.julialang.org/t/faster-conversion-to-categoricalarray-with-many-groups/55057)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 3\
**Last updated:** [February 11, 2021, 4:15pm UTC](https://discourse.julialang.org/t/faster-conversion-to-categoricalarray-with-many-groups/55057 "2021-02-11T16:15:00Z")

</div>

I need to convert columns in a larger (~20M rows) DataFrame to CategoricalArrays to be used with MixedModels and FixedEffectModels (I think the latter does not require Categorical but the former does). If there are many …

---

## [Abstract-type field in struct for solving an ODE problem](https://discourse.julialang.org/t/abstract-type-field-in-struct-for-solving-an-ode-problem/55050)

<div class="topic-metadata">

**Author:** [@hopeso](https://discourse.julialang.org/u/hopeso)\
**Replies:** 1\
**Last updated:** [February 11, 2021, 10:06am UTC](https://discourse.julialang.org/t/abstract-type-field-in-struct-for-solving-an-ode-problem/55050 "2021-02-11T10:06:47Z")

</div>

Hi, I’m learning Julia and particularly interested in solving differential equations using the DifferentialEquations package. I’m having a trouble with understanding how to make a good type-stable struct that is integrat…

---

## [Problem on benchmarking multi-thread code](https://discourse.julialang.org/t/problem-on-benchmarking-multi-thread-code/55021)

<div class="topic-metadata">

**Author:** [@ykkan](https://discourse.julialang.org/u/ykkan)\
**Replies:** 3\
**Last updated:** [February 10, 2021, 8:27pm UTC](https://discourse.julialang.org/t/problem-on-benchmarking-multi-thread-code/55021 "2021-02-10T20:27:01Z")

</div>

Hello, I am trying to benchmark function with thread parallelization and compare the result with non-parallelized version of function. using Base.Threads nx = 10000 a = zeros(nx) b = rand(nx) dindicies = 2:(nx-1) fun…

---

## [Is this a valid way of evaluating string of code in local scope?](https://discourse.julialang.org/t/is-this-a-valid-way-of-evaluating-string-of-code-in-local-scope/54996)

<div class="topic-metadata">

**Author:** [@calebwin](https://discourse.julialang.org/u/calebwin)\
**Replies:** 6\
**Last updated:** [February 10, 2021, 5:21pm UTC](https://discourse.julialang.org/t/is-this-a-valid-way-of-evaluating-string-of-code-in-local-scope/54996 "2021-02-10T17:21:34Z")

</div>

From what I’ve read and observed, it seems like there isn’t a way of eval-ing code in local scope or otherwise without incurring significant performance penalty (lots of extra memory allocations and significantly longer …

---

## [Why is hashing Dicts faster than Arrays?](https://discourse.julialang.org/t/why-is-hashing-dicts-faster-than-arrays/54963)

<div class="topic-metadata">

**Author:** [@bsuwal](https://discourse.julialang.org/u/bsuwal)\
**Replies:** 1\
**Last updated:** [February 10, 2021, 3:15am UTC](https://discourse.julialang.org/t/why-is-hashing-dicts-faster-than-arrays/54963 "2021-02-10T03:15:17Z")

</div>

I am suprised as to why hashing dicts is faster than arrays: d = Dict{Int, Int}(\[i =\> i for i in 1:10\]) n = 10000000 @btime begin for i = 1:n hash(d) end end gave me 1.457 s (39998979 allocations: 762.9…

---

## [Julia v1.6: \`using\` is faster but first call is slower](https://discourse.julialang.org/t/julia-v1-6-using-is-faster-but-first-call-is-slower/54838)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 1\
**Last updated:** [February 8, 2021, 12:30pm UTC](https://discourse.julialang.org/t/julia-v1-6-using-is-faster-but-first-call-is-slower/54838 "2021-02-08T12:30:22Z")

</div>

Thanks a lot to all contributors to reduce latency in the new release candidate of Julia v1.6 - great work! I recognized that using can be significantly faster in Julia v1.6, but the first function call becomes signific…

---

## [Using views causes significant slowdown in simple PDE](https://discourse.julialang.org/t/using-views-causes-significant-slowdown-in-simple-pde/54803)

<div class="topic-metadata">

**Author:** [@bgroenks](https://discourse.julialang.org/u/bgroenks)\
**Replies:** 2\
**Last updated:** [February 7, 2021, 4:39pm UTC](https://discourse.julialang.org/t/using-views-causes-significant-slowdown-in-simple-pde/54803 "2021-02-07T16:39:32Z")

</div>

I have stumbled upon a frustrating performance issue with either DifferentialEquations.jl or the Julia compiler (or maybe my code?). The motivating use-case is the application of the 1-dimensional heat equation (and poss…

---

## [How to make Julia call C/C++ coded function](https://discourse.julialang.org/t/how-to-make-julia-call-c-c-coded-function/54780)

<div class="topic-metadata">

**Author:** [@Valery](https://discourse.julialang.org/u/Valery)\
**Replies:** 6\
**Last updated:** [February 7, 2021, 3:58pm UTC](https://discourse.julialang.org/t/how-to-make-julia-call-c-c-coded-function/54780 "2021-02-07T15:58:22Z")

</div>

Hi all, I am a complete beginner in Julia. My question is: how to make a julia script call C or C++ coded function. If it’s possible, can this enhance the performance in term of speed of execution (if we compare it wit…

---

## [Type Inference Problem with \`getproperty\`](https://discourse.julialang.org/t/type-inference-problem-with-getproperty/54585)

<div class="topic-metadata">

**Author:** [@drbassett](https://discourse.julialang.org/u/drbassett)\
**Replies:** 6\
**Last updated:** [February 6, 2021, 10:19pm UTC](https://discourse.julialang.org/t/type-inference-problem-with-getproperty/54585 "2021-02-06T22:19:41Z")

</div>

I apologize in advance for the long post, but I did a good deal of my own analysis first to make sure I was understanding the situation correctly. I wanted to post my findings to save others the trouble of going through …

---

## [Combinatorial Type Explosion: Nested Parameteric Types](https://discourse.julialang.org/t/combinatorial-type-explosion-nested-parameteric-types/54652)

<div class="topic-metadata">

**Author:** [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Replies:** 12\
**Last updated:** [February 5, 2021, 10:38pm UTC](https://discourse.julialang.org/t/combinatorial-type-explosion-nested-parameteric-types/54652 "2021-02-05T22:38:02Z")

</div>

Let us say I have a bunch of functions that I want to modify based on the stream type. Different density methods for liquid streams and gas streams etc. I create an abstract type “Substance” and define the stream as foll…

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

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