performance: How to measure: LXML or DB queries?

27 views
Skip to first unread message

ydjango

unread,
Jul 10, 2012, 5:44:42 PM7/10/12
to django...@googlegroups.com

Few ajax calls are very slow to return. The ajax call basically queries data from mutiple tables ( using Django ORM), create an XML using LXML and returns the XML.
What is the best way to measure where the performance bottleneck is?

I think it is DB access. LXML is the fastest XML library in python. Are there any tools I can use to measure?

Nikolas Stevenson-Molnar

unread,
Jul 10, 2012, 6:04:30 PM7/10/12
to django...@googlegroups.com
Try the django-debug-toolbar:
https://github.com/django-debug-toolbar/django-debug-toolbar

It will show you all queries executed for a request and how long they
take. Of course, you'll have to disabled if when actually using the
AJAX, since the toolbar injects itself into the response. But you could
turn it on, make the request directly in your browser, and use the
toolbar to figure out what's going on.

_Nik
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-5CVFDEkc4QJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


Reply all
Reply to author
Forward
0 new messages