Sympy CPU usage

59 views
Skip to first unread message

Paul Royik

unread,
Jun 2, 2015, 12:53:38 PM6/2/15
to sy...@googlegroups.com
Hello.
I noticed that sympy uses much CPU.
Is there any way I can control its usage or control the code where it might occur.
For now my code uses match extensively, but I still don't know what functions use much CPU: simplify, integrate, match etc.
Also, is clear_cache impacts CPU usage?

Thank you.

Aaron Meurer

unread,
Jun 2, 2015, 1:11:20 PM6/2/15
to sy...@googlegroups.com
The first step would be to use a profiler to figure out what part of
SymPy is using the CPU. The profiler in the standard library is a good
start (python -m profile). Another option that I like a lot is
pyinstrument.

It's also possible that your own code is doing something inefficiently.

In general, the CPU usage of various functions like simplify and
integrate can vary widely depending on what kind of expressions you
pass to them.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/8776e1bd-d7fe-431a-bfa3-25a46708d125%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Paul Royik

unread,
Jun 2, 2015, 1:53:02 PM6/2/15
to sy...@googlegroups.com
OK.
Thank you very much.
Will try.

Paul Royik

unread,
Jun 2, 2015, 4:22:52 PM6/2/15
to sy...@googlegroups.com
Is there anyway I can profile django app?
Because sympy code is used from django app.


On Tuesday, June 2, 2015 at 8:11:20 PM UTC+3, Aaron Meurer wrote:

Sudhanshu Mishra

unread,
Jun 9, 2015, 7:30:25 AM6/9/15
to sy...@googlegroups.com
Hi,

Any normal profiler should work in views as mostly logic stays there.

Sudhanshu Mishra
Reply all
Reply to author
Forward
0 new messages