# DiffEq skips over event in the first \`solve\` but works after \`reinit!\`

**URL:** <https://discourse.julialang.org/t/diffeq-skips-over-event-in-the-first-solve-but-works-after-reinit/90935>\
**Category:** Modelling & Simulations\
**Created:** [November 28, 2022, 5:08am UTC](https://discourse.julialang.org/t/diffeq-skips-over-event-in-the-first-solve-but-works-after-reinit/90935 "2022-11-28T05:08:03Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 3, 2022, 3:41am UTC](https://discourse.julialang.org/t/diffeq-skips-over-event-in-the-first-solve-but-works-after-reinit/90935/16 "2022-12-03T03:41:27Z")

</div>

> [@cuihantao](#):
>
> There is a total of 645 allocations: 32.42 KiB. The optimization example here ([Code Optimization for Differential Equations · DifferentialEquations.jl](https://diffeq.sciml.ai/stable/tutorials/faster_ode_example/#Example-Accelerating-a-Non-Stiff-Equation:-The-Lorenz-Equation)) only has 41 allocations. Is my allocation number normal?

A lot of those allocations are just saving the time series. I think there’s some more in the callback code that I need to eliminate though.

---

_[View the full topic](https://discourse.julialang.org/t/diffeq-skips-over-event-in-the-first-solve-but-works-after-reinit/90935)._
