[yt-dev] Issue #1088: Iterating over a time series is much slower in 3.x compared to 2.x (yt_analysis/yt)

Nathan Goldbaum issues-reply at bitbucket.org
Sun Oct 4 14:21:44 PDT 2015


New issue 1088: Iterating over a time series is much slower in 3.x compared to 2.x
https://bitbucket.org/yt_analysis/yt/issues/1088/iterating-over-a-time-series-is-much

Nathan Goldbaum:

This causes a significant slowdown when running the enzo test suite under yt 3.x.

Test script (can be run under both yt-2.x and yt-3.x):

```
from yt.mods import *
from yt.utilities.logger import disable_stream_logging
disable_stream_logging()

sim = simulation('enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo', find_outputs=True)
sim.get_time_series()

for ds in sim:
    print ds
```

On my laptop, under yt-3.x this runs in 6.5. In a docker container running on a VM (quickest way I had to get a yt-2.x installation), the same script runs in 864 ms.

The main slowdown seems to be the ` _add_object_class` function in the `Dataset` base class. A way around this might be to somehow cache the structure of the dataset from one iteration loop to the next or alternately figure out how to instantiate `Dataset` instances much faster.





More information about the yt-dev mailing list