oxinabox / MagneticReadHead.jl

A cassette-based debugger | The Other Debugger
MIT License
50 stars 6 forks source link

Don't store Stepping State or Breakpoint Rules in the context #67

Closed oxinabox closed 5 years ago

oxinabox commented 5 years ago

I had hoped this would help with #56, for reasons. It did not.

But I was planning on doing this anyway as at some point I intend to switch over to IRTools. and IRTools doesn't have the notion coresponding to Cassette's context.

Turns out (as I suspected) this does not have any performance impact. Infact it gives a 5% speedup (and 200bytes less allocations)

Before:

julia> @btime @run summer($(rand(4000)))
  8.950 ms (36948 allocations: 827.42 KiB)
2005.1816094488515

julia> @btime @run summer($(rand(4000)))
  9.070 ms (36948 allocations: 827.42 KiB)
2003.61408723352

julia> @btime @run summer($(rand(4000)))
  9.019 ms (36948 allocations: 827.42 KiB)
2004.4255763210997

After

julia> @btime @run summer($(rand(4000)))
  8.364 ms (36948 allocations: 827.41 KiB)
2000.0012459445081

julia> @btime @run summer($(rand(4000)))
  8.502 ms (36948 allocations: 827.41 KiB)
2014.4012688708347

julia> @btime @run summer($(rand(4000)))
  8.262 ms (36948 allocations: 827.41 KiB)
1997.3189807056297