JuliaMolSim / Molly.jl

Molecular simulation in Julia
Other
372 stars 51 forks source link

Update adjust_bounds by removing iteration #40

Closed ehgus closed 3 years ago

ehgus commented 3 years ago

The adjust_bounds is optimized into a one-line using the floor in base julia. Here is the simple benchmark.

benchamarked julia version : 1.6.1

julia> @time adjust_bounds(90001.0,3.0)
  0.000029 seconds
1.0

julia> @time adjust_bounds_new(90001.0,3.0) # this is the function proposed
  0.000000 seconds
1.0
jgreener64 commented 3 years ago

Clear improvement, thanks.