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,573 questions
Filter by
Sorted by
Tagged with
29 views

A general question about speed of working with interpolating functions

Consider a grid {x,y,z,f(x,y,z)} Here, x,y,z are real numbers, and f is a function that first monotonically increases with its argument $z$, and then quickly ...
253 views

NIntegrate: the order of singular points matters!

Consider the following integral: $$I = \int_{-5}^5 \frac{1}{(x(x-2))^{1/3}} dx.$$ The exact value is 6.30249 - 2.2405 I. I will perform ...
85 views

Faster searching for subsets with pairwise conditions

I am looking for a faster way of finding large subsets of lists that obey pairwise conditions. In particular, I'm looking for a large (over 10k) set of quaternary words (i.e. ordered lists) of length ...
34 views

NIntegrate With Singularity: Experiment With Various Parameters

I want to numerically evaluate the integral $$I = \int_{\mathbb R^2} dxdy f^*(x) f(y) K(x-y)dxdy,$$ where $$f(x) = \sqrt{\frac 2 \pi} e^{ikx} e^{-x^2}, \quad k\in\mathbb R$$ is an exponentially ...
67 views

How to analyse the performance of Mathematica on this function?

Using f[n_] := Sum[1/(Sqrt[k] + Sqrt[k + 1]), {k, 1, n}] to analyze the well-know series... I noticed a sudden performance drop (on my outdated PC hardware ) ...
41 views

237 views

Solving for a unique set of solutions

I have the following code: ...
110 views

Is it possible to improve a code related with iterative closest point (ICP) algorithm?

I am trying to write a code related with ICP algorithm. The purpose of the code is matching a target data with a reference data by translational operation in XYZ axes (3-degree-of-freedom (DOF) ...
53 views

Accelerate the retrieval time for Entity data

I like to use Mathematica to answer questions related to cities such as how many cities in the United States have a population greater than 100,000 and what the distribution of them would look like on ...
308 views

How can I speed up RandomVariate in the following case?

I would like to generate random values of some parameter with the weight being the Poisson distribution. An important point is that each time I generate the random number I need to consider the ...
34 views

How to optimize Code for Wolfram Challenges?

I am wondering if anyone who has knowledge of optimizing programs in the Wolfram language has any advice on how to optimize the following quantities of programs written to solve Wolfram Challenges. I ...
169 views

How to sort lines into continous paths efficiently

As part of my work I get a bunch of lines from my co-worker. (Background: I do electromagnetic designs, my co-worker does the mechanical design). These lines are in random order, but I need them in ...
26 views

Optimizing an 2D-NIntegrate in terms of speed

I am trying to optimize the following function further in terms of speed while maintaining the given Precision and correctness. The function decribes the two dimensional convolution of a sum of Bessel ...
49 views

Why is Clip so slow and how can I improve its performance?

The built-in function Clip is defined as a way to clip a value between a specified minimum and maximum. Another way to do this, is simply by utilizing ...
61 views

How do I optimize a simulation containing both a While loop and a Do loop?

I have written a simulation of a rotating molecule that I was hoping to get help to optimize. Below you see the main function in the simulation. The function FlatPart calculates the angle θ and the ...