# Questions tagged [performance-tuning]

Questions on optimizing Mathematica code for higher performance. This may mean faster execution, lower memory usage or both. Not to be confused with mathematical optimization.

2,269 questions
Filter by
Sorted by
Tagged with
146 views

### Making a faster alternative for {PatternSequence[1, PatternSequence[2, 3 ..] ..] ..}

I need to improve a pattern or switch an approach. It is best described by an example For a hierarchy/order given by a list e.g.: order = {1, 2, 3} and a list: <...
13 views

### How to memoize with patterns? [duplicate]

Here is an artificial example to explain what I am up to. Define ClearAll[f] f[x_, y_] := f[x, y] = If[x == 0, g[y], g[f[x - 1, y]]] Then ...
31 views

365 views

### Why are more highly nested lists often not more memory and time-intensive?

I would expect more highly nested lists, being deeper and more complex than flatter lists, to take up more space (bytecount) and take more time and memory to operate on in general. Consider the ...
### How to partition $[a,b]$ into $m$ equal sub-intervals and count the number of sub-intervals that intersect with a subset of $[a,b]$?
Suppose we have a subset of $[a,b]$, where $a=0$ and $b=1$, such as $$A_1=\left\{\frac{1}{2^x}+\frac{1}{2^y}+\frac{1}{2^z}:x,y,z\in\mathbb{Z}\right\}\cap[0,1]$$ Which is a subset of $[0,1]$ If we ...