Skip to content

Optimizing end-to-end performance of an algorithm #201

Answered by freemin7
freemin7 asked this question in Q&A
Discussion options

You must be logged in to vote

Since i can't get the tooling working i wrote up a simulation of the effect i mean.

function simulation1(speedup)
       snapshots = [0.0];
       N = 10.0
       timer = 0.0
       while N > 0.2
           round_start = timer
           while timer - round_start < 0.5
               N *= 0.95; #work
               timer += 0.3/speedup #takes time
           end
       end
       append!(snapshots, timer) #progress point
       return snapshots
end

For each array of snapshots i process them as such:

average_time  = [ sum(simulation1(s))/length(s) for s in 1.0:0.05:2.9 ];
total_time = [ maximum(simulation1(s)) for s in 1.0:0.05:2.9 ];
max_dif_time = [ maximum([simulation1(s)[i] - simulation1

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@emeryberger
Comment options

Answer selected by emeryberger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants