Open ranocha opened 3 years ago
The implementation of @timeit_debug
is not great and has some performance problems. However, I did not know that @timeit
has any such problems. Do you have a smaller example where @timeit
gives extra allocations on 1.6 vs 1.5?
I'm sorry, I've been trying to create a smaller example but haven't been successful so far.
This example doesn' run, I get:
ERROR: LoadError: ArgumentError: Package OrdinaryDiffEq not found in current path:
- Run `import Pkg; Pkg.add("OrdinaryDiffEq")` to install the OrdinaryDiffEq package.
Sorry, I added Pkg.add("OrdinaryDiffEq")
above - it's in my default environment so I didn't notice the error. It should run now as it is.
A reason for allocations was the use of a try ... catch ...
block in TimerOutputs. I implemented our own reduced version of @timeit_debug
without that in https://github.com/trixi-framework/Trixi.jl/pull/509 and could fix some type instabilities and allocations coming from @timeit_debug
. Maybe it could be an option to @timeit
and @timeit_debug
to avoid this try
block as well?
There could be a @timeit_nothrow
.
Thanks for this nice package! We use it in our hyperbolic PDE solver Trixi.jl and are really happy to be able to do so. When testing the release candidate of Julia v1.6, I noticed that we get additional allocations compared to Julia v1.5.3, which seem to be caused by TimerOutputs.jl.
On Julia v1.5.3, I get
On Julia v1.6.0-rc1, I get
If I use Revise.jl and modify the parts where
@timeit_debug
is used, e.g. by replacing them by@timeit
, much (if not all) of the allocation overhead in Julia v1.6 is gone. However, if I replace@timeit_debug
by@timeit
and start Julia v1.6 from scratch, I get again the same allocations (when having Trixi.jl in development mode instead of adding a registered version as in the MWE above).