#27279: Slow test framework initialization in 1.10.1 compared to 1.10
-------------------------------------+-------------------------------------
Reporter: mtomiyoshi | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Migrations | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by mtomiyoshi):
Ok, so I did something stupid when trying Simon's suggestion and that's
why it was so slow... Sorry about that!
With a proper implementation of his suggestion the time to run an empty
test got down to around 5-6 seconds in total, even better than what I was
seeing with 1.10 (which was around 9-10 seconds). I also tried Marten's
patch and it also runs around the same 5-6 seconds here, so I would say
both implementations are great!
Replying to [comment:9 Marten Kenbeek]:
> Can you try the patch I've attached to the ticket? It may or may not
make much of a difference compared to Simon's patch. If it doesn't make a
difference, we can at least pinpoint the performance degradation to what
happens ''during'' the `RenameModel.state_forwards()` method.
>
> For the profile files: could you use the `-o <output_file>` option? That
will write all the raw profile data to the file, not just the output to
stdout. We can then use the `pstats` module to analyze e.g. the
caller/callee graph.
>
> > I am not sure if I understood correctly, but I tried setting a
breakpoint on that return line and it got called only once (that one call
> > was made by a RenameModel operation). Is this what you were expecting?
>
> With the regular 1.10.1, I would indeed expect this to be called once,
when the first `RenameModel` accesses `state.apps`. With Simon's patch I
would expect it to be called a few times: once for each migration
containing a `RenameModel` operation, and once when rendering the final
project state.
--
Ticket URL: <https://code.djangoproject.com/ticket/27279#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.5a695ca5d6a8c0fcce55181766a13b3a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.