# Theano (compilation or execution) takes too much time to do one simulation

**URL:** https://discourse.pymc.io/t/theano-compilation-or-execution-takes-too-much-time-to-do-one-simulation/5997
**Category:** Questions
**Tags:** theano
**Created:** [October 15, 2020, 1:32pm UTC](https://discourse.pymc.io/t/theano-compilation-or-execution-takes-too-much-time-to-do-one-simulation/5997 "2020-10-15T13:32:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ar-valdez](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ar-valdez/32/2848_2.png) [@ar-valdez](https://discourse.pymc.io/u/ar-valdez)
#### Post date: [October 15, 2020, 1:32pm UTC](https://discourse.pymc.io/t/theano-compilation-or-execution-takes-too-much-time-to-do-one-simulation/5997/1 "2020-10-15T13:32:44Z")

</div>

In my script, I perform a fitting with `lmfit` the fitting routine called 80 times the solver to compare calculation with experimental (observed data) this took 20 seconds.

After the fitting, I want to execute `PyMC3` using `theano` to determine the posterior distributions for each model parameter. Here I am using `pm.Slice()` and each call is demanding 10 seconds…

I want to know if this has already happened before, and how to speed up?

Thanks.-

Ps.: My function has a try, except statement. The “failed” case returns some vale out of sense, to avoid digging in that samples
