# performance-tuning's questions - English 1answer

1.798 performance-tuning questions.

### 5 How to achieve faster performance on plotting complex valued functions

I'm very interested in visualizing complex valued functions $f:\mathbb{C} \rightarrow \mathbb{C}$. Especially interesting to me are Möbius transformations. I found a nice way of visualizing these ...

### 7 Speeding up Nearest with multiple distance thresholds

Consider the following example of using Nearest: ...

### 7 Fastest/cleanest way to pad data with zero-data

4 answers, 390 views list-manipulation performance-tuning
I want to pad a set of data in {x, y} pairs with {x, 0}, {x, 0} on each side of each data ...

### 1 Horrendously slow DateListPlot & Tooltip - causes, workarounds, fixes?

MMA 11.0.1.0 Win 10 64-bit i8700K The question is: how can one efficiently and speedily produce DateListPlots (or ListLinePlots with a date-time labelled x-axis calculated from x ordinates measure in ...

### 3 Crashes of Classify function

I'm working on a classifying two classes. I am training my Classify function with the RandomForest method, but it crashes. The ...

### 7 Reap, Sow with Parallelize: bad performance, why?

I have a question about the performance of Reap and Sow with Parallelize. I am aware of the following questions How to collect result continuously (interruptible calculation) when running parallel ...

### Plotting an element of large array is slow

0 answers, 22 views plotting performance-tuning array
I get a slow down when using ContourPlot on elements of a large array of messy expressions. That is, if fooArray has 100 elements and I plot the first 3, that's much slower than if fooArray has 3 ...

### 4 Writing Faster Mathematica Code - Sow and Reap?

1 answers, 528 views performance-tuning filtering sow-reap
I am applying Select function to a large list called xyCoordinateCentreCircle. The dimensions of the list are: ...

### 1 Speed up construction of large matrix with if statements

I am constructing a matrix of the form  T_{i_aj_ak_al_a,i_bj_bk_bl_b} = T_{i_ai_b}\delta_{j_aj_b}\delta_{k_ak_b}\delta_{l_al_b} + T_{j_aj_b}\delta_{i_ai_b}\delta_{k_ak_b}\delta_{l_al_b} + T_{k_ak_b}\...

### 1 Test if data is regularly sampled

0 answers, 23 views performance-tuning data
I want to determine whether I have regularly sampled data or not, a là RegularlySampledQ. The data itself might be huge. I tried a bunch of different approaches and ...

### 2 Unable to use Solve to solve simultaneous equations, or use Maximize for exact maximum solution

Mathematica has found that the maximum of the following function is negative using NMaximize, but I am trying to prove that the maximum is negative (i.e. that the ...

### 1 Is there a way to automate this procedure?

I have some code which numerically solves a differential equation for a given value of the parameter $M0$ and for some initial conditions. The initial conditions will remain fixed throughout the ...

### Integral evaluating very slowly

I am trying to evaluate the following simple integral: ...

### 3 Speeding up the calculation of a binomial sum

Is it possible to speed up this calculation?A[j_, p_, n_] := Sum[Binomial[n, k] p^k (1 - p)^(n - k), {k, 0, j}] Plot[{A[j, 0.5, 12000]}, {j, 0, 12000}]Thanks!

### 1 Reduce Plot3D evaluation time?

2 answers, 33 views plotting performance-tuning timing
I have a large function func[a,b] and I need its Plot3D. Since the command ...

### 27 Efficient way to count the number of zeros at the (right) end of a very large number

If I want to count the number of zeros at the (right) end of a large number, like $12345!$, I can use something like:Length[Last[Split[IntegerDigits[12345!]]]]...

### 4 Code to generate series expansion ran fine in M10, not in M11

2 answers, 57 views performance-tuning series-expansion
I have a simple code to get a planet's true anomaly as a function of time, using Newton's method and a series expansion. (Note that I purposefully iterate Newton's method two more times than the order ...

### How to speed up this calculation regarding the normal distribution?

This calculation takes a very long time! Why? How can I improve it? Thanks! ...

### 13 Improve the mesh smoothing procedure

My question is inspired by this answer about meshing with quadrilateral elements. The following functions are my (naive) try of implementing the Laplacian smoothing. I find interior nodes in the mesh ...

### 3 SystemException[“MemoryAllocationFailure”] with compile and speed issues

1 answers, 46 views performance-tuning compile memory
I am trying to run a code that gives out a matrix but, I seem to encounter some memory issues while trying to run it. The code is: ...

### 5 How do computational resources required for NDSolve scale with integration time?

In a nutshell I have a large system of ODE. When I integrate the system from x = 0 to x = dx, ...

### 5 Querying vertex properties on graphs whose vertices are lists

Bug introduced in 10.0 or earlier and fixed in 11.3 Cross-posted on Wolfram Community Consider the following graph with the vertex property "foo". ...

### Increasing the speed of sparse array

I am trying to find a sparse matrix of the size Col x Rows = 16777216 x 1024 where all the elements are 0 except the ones given ...

### 6 Clever caching of a recursively defined function

I've got a function of the form f[n,s] where n is a natural number and s is a finite ...

### 1 Finding an optimal location of 2D points?

I have a function f that returns the number of triangles formed by given line segments. For example, in the following case f ...

### Optimization with constraint or with the constraint embedded into the problem?

I need to find the minimum of a function. However, the condition is that the final state should be normalized i.e. sum of the squares must be one. One way to deal with it is just add the constraint ...

### 8 Delete all strings that are prefixes of another string

I have a long list of strings and I'm trying to find a more efficient way of removing those elements that are prefixes of another: ...

### What is the fastest way to build a simple table?

Question: What is the fastest way to obtain a table of values from a parametrized function? For a function of x, which is a sum of ...

### 3 Whats the difference between Cases and Select? [duplicate]

1 answers, 58 views performance-tuning coding-style
Im trying to further my understanding of mathematica coding and came up across this question. What is the main difference between Cases and ...

### Why does Table[] slow down exponentially with increasing length? [closed]

1 answers, 53 views performance-tuning table memory
I haven't been able to find anything to specifically answer my question: When using Table[], I find that, for a program I am working on (I would post the code but ...

### 16 Efficient way to simulate thousands of Markov chains

I am currently trying to simulate relaxation of a protein population while maintaining the stochastic properties of the system. For this, I used a Markov chain to describe the temporal evolution of ...