Linked Questions

0
votes
0answers
45 views

What could cause Timing to report erroneously? [duplicate]

I am using Timing to measure the time it takes to load a ".dat" file and the reported time (4.47 seconds) is waaaay below the real time (measured using a stopwatch ...
48
votes
1answer
4k views

Why won't Parallelize speed up my code?

What reasons are there that can cause parallelized Mathematica code not to run with full performance?
25
votes
2answers
9k views

Measuring execution time of code

How one can measure the execution time (time that is spent for code to finish) of a program in Mathematica? I understand that there are general timing functions (Timing, AbsoluteTiming, TimeUsed, etc....
25
votes
4answers
1k views

Throwaway memoization makes built-ins faster?

Yesterday I got into an argument with @UnchartedWorks over in the comment thread here. At first glance, he posted a duplicate of Marius' answer, but with some unnecessary memoization: ...
8
votes
6answers
454 views

Deleting duplicates of a list without touching specified elemets

Suppose I have a list, for example: list = {1, 3, 5, 5, 12, 12, 6, 11, 7, 7, 9, 10, 2, 2, 4}; and list of duplicates positions in the list ...
20
votes
2answers
532 views

Incorrect Timing of Total

For demonstrating how fast C-compiled functions can be, in one of my courses I use the following function for finding the sum of a list of reals: ...
5
votes
3answers
1k views

Incresing efficiency of the code:

I have a set of points, representing location of events in a map, and I want to find the closest neighbour for each point. Variable xys is a 2D matrix containing ...
18
votes
1answer
271 views

Why Function is not identical to `&` in autocompilation?

Here is the example, copied from here square = Function[x, x^2]; square1 = #^2 &; the timing and unpacking status shows ...
1
vote
3answers
277 views

Fastest way to find roots

I'm working with generative polynomials, and would like to know if there is a faster way to calculate roots. Using the technique below I've managed to cut the time down significantly. However at n=35, ...
3
votes
2answers
99 views

NIntegrate timing discrepancy

When I run the following identical numerical integrals ...
1
vote
1answer
156 views

Why, according to Timing, is this code so FAST?

Obviously (?) I have a problem with precision or something but MMA seems to be able to take the mean squared of a 1e7 long series of random reals in literally no time, unless I use RepeatedTiming ...
6
votes
0answers
136 views

Difference between Timing, AbsoluteTiming, and Elapsed?

In the picture below, Difference between Timing, AbsoluteTiming, Time and ...
1
vote
1answer
80 views

How to make that interpolation?

I have the following dataset: SetDirectory[NotebookDirectory[]]; TableSpectrum = Import["spectrum.dat", "Table"]; I want to make the interpolation. However, when ...
0
votes
0answers
113 views

strange timing behavior

The following code is from a book about Mathematica. ...
1
vote
1answer
49 views

Why do I keep getting the same time from the Timing function?

I am running a gamblers problem solution where I am testing the timing involved in solving the Ax = b equation for matrices of n=100, 1000, 10000, and 100000. For some reason I keep getting the same ...