Questions tagged [timing]

This Tag is used for two things: Questions regarding improving execution speed and questions where various methods are compared for execution speed.

140 questions
26
votes
2 answers

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.) that can be used for measuring CPU or wall…
sky-light
  • 827
  • 1
  • 12
  • 24
6
votes
1 answer

Timing mathematica code

I have a collection of functions (Modules) and I wish to find out which sub-routines inside the code take up most time. I have done this by wrapping individual code blocks with Print[Row[{"comment: ", AbsoluteTiming[ --- code --- ]}]]; This is…
Thomas
  • 1,967
  • 1
  • 15
  • 18
6
votes
2 answers

Time elapsed for aborted computation?

I have a computation which is taking very long AbsoluteTiming[sr = ShellRegion@region]; Instead of getting $Aborted, is there a system method to get a time estimate of how long it was running before being aborted?
M.R.
  • 31,425
  • 8
  • 90
  • 281
3
votes
1 answer

A problem with Timing

With M = Partition[Range@10000000, 1000]; V = Range[10000] - 1; I got the following timings: Table[Prepend[M, V]; // Timing // First, {10}] {0.358802, 0.561603, 0.546003, 0.546003, 0.577203, 0.592803, \ 0.561603, 0.577203, 0.561603,…
eldo
  • 67,911
  • 5
  • 60
  • 168
3
votes
1 answer

Why Dot product of my vectors takes longer than usual?

I have a list containing 100 complex numbers lying between 1.9 + 1.9 i and 2.0 + 2.0 i you can download its mx file from the link below and import it in Mathematica: http://adambarfib.ir1.rapidpars.com/17830/18651983/s4fkhv5c31j/vec.mx Now if you…
3
votes
1 answer

More realistic timings for evaluations with large outputs

What timing method will take into account all (kernel and frontend) operations? rel = CloudGet[ "https://www.wolframcloud.com/objects/bc960912-ff24-43bc-9dbd-04cf23bbcd70"]; start = Now; Timing[Graph[rel, GraphStyle -> "Vintage", PerformanceGoal…
M.R.
  • 31,425
  • 8
  • 90
  • 281
2
votes
3 answers

Summing all the times of a column

It is possible to add a last row in the table where I can show the sum of values of the last column. I would like to get the total time value... data = { {"Caixa Pokémon", DateObject[{2019, 8, 27}], 22.41, TimeObject[{2, 35}]}, {"Cortador…
LCarvalho
  • 9,233
  • 4
  • 40
  • 96
1
vote
1 answer

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 which reports that the average time to do the mean…
Julian Moore
  • 2,560
  • 1
  • 12
  • 20
0
votes
0 answers

Can we explain why Timing is inconsistent?

I am trying to speed up a code and by placing Timing statements in the code I identified a suspect calculation that I do repeatedly. In order to test out the calculation I generated some random numbers and looked at the timing of the calculation…
Hugh
  • 16,387
  • 3
  • 31
  • 83
0
votes
1 answer

Inverse taking no time?

I was comparing the time that the computer takes to perform Partial Pivoting, Total Pivoting and multiplying by the inverse. The code (that makes the comparison chart) is as follows: ListPlot[{Table[ AbsoluteTiming[ …
0
votes
0 answers

What could cause Timing to report erroneously?

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 on my phone) which is about 44 seconds. I've never encountered such behaviour and I…
Benjamin Márkus
  • 327
  • 2
  • 11