#13400: Use strong caches diligently
-------------------------------+--------------------------------------------
Reporter: nbruin | Owner: robertwb
Type: enhancement | Status: new
Priority: major | Milestone: sage-wishlist
Component: coercion | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-------------------------------+--------------------------------------------
Comment (by nbruin):
I've extracted the
[http://sage.math.washington.edu/home/nbruin/pa_doctests.sage
partition_algebra doctests]
into a file (this one's easy: no error, all one-line, so select all lines
with "sage:", move the import up to and stuff it all in a function)
vanilla 5.3b2:
{{{
6990672 function calls (6690605 primitive calls) in 11.670
seconds
237883 2.732 0.000 7.992 0.000 set.py:197(__init__)
238208 0.719 0.000 3.054 0.000 {hasattr}
255896 0.440 0.000 0.440 0.000
dynamic_class.py:122(dynamic_class)
957865 0.374 0.000 0.374 0.000 {getattr}
152230 0.335 0.000 5.312 0.000 set.py:42(Set)
912924 0.247 0.000 0.247 0.000 {isinstance}
350344/344228 0.218 0.000 0.310 0.000 set.py:700(set)
88799/56520 0.201 0.000 7.396 0.000
set_partition.py:344(_listbloc)
237883 0.193 0.000 8.185 0.000 set.py:603(__init__)
17034 0.185 0.000 0.259 0.000 combinat.py:962(__init__)
85769 0.185 0.000 3.341 0.000 set.py:827(union)
237891 0.108 0.000 3.161 0.000
sets_cat.py:255(_element_constructor_)
409319 0.103 0.000 0.103 0.000 set.py:566(object)
14600 0.097 0.000 7.554 0.001
cartesian_product.py:138(__iter__)
26068 0.089 0.000 0.773 0.000 subset.py:464(__iter__)
9431 0.079 0.000 10.116 0.001
set_partition.py:221(_iterator_part)
35639/35611 0.067 0.000 0.212 0.000 {map}
227219 0.062 0.000 0.119 0.000 set.py:634(__iter__)
17043 0.060 0.000 0.173 0.000
permutation.py:123(Permutation)
6169 0.060 0.000 1.287 0.000
set_partition_ordered.py:388(__iter__)
249245 0.059 0.000 0.059 0.000 {setattr}
17700 0.059 0.000 2.755 0.000
set_partition.py:395(_set_union)
}}}
5.32b + ticket + Thierry's fixed code
{{{
7381196 function calls (7077132 primitive calls) in 19.272
seconds
488462/247161 3.742 0.000 5.013 0.000
lazy_attribute.py:506(__get__)
241678/241677 0.712 0.000 3.074 0.000 {hasattr}
259646 0.572 0.000 0.883 0.000
dynamic_class.py:122(dynamic_class)
17349 0.531 0.000 0.665 0.000 combinat.py:962(__init__)
154600 0.371 0.000 9.548 0.000 set.py:42(Set)
971690 0.364 0.000 0.364 0.000 {getattr}
90486/57843 0.275 0.000 12.905 0.000
set_partition.py:344(_listbloc)
929509 0.261 0.000 0.261 0.000 {isinstance}
271183 0.256 0.000 0.256 0.000 weakref.py:55(__getitem__)
354289/348145 0.227 0.000 0.320 0.000 set.py:700(set)
241276 0.208 0.000 14.688 0.000 set.py:603(__init__)
86757 0.201 0.000 5.423 0.000 set.py:827(union)
14889 0.156 0.000 13.078 0.001
cartesian_product.py:138(__iter__)
9597 0.146 0.000 17.137 0.002
set_partition.py:221(_iterator_part)
17881 0.131 0.000 4.838 0.000
set_partition.py:395(_set_union)
241301 0.107 0.000 3.180 0.000
sets_cat.py:255(_element_constructor_)
414348 0.105 0.000 0.105 0.000 set.py:566(object)
26411 0.096 0.000 0.915 0.000 subset.py:464(__iter__)
36450/36422 0.070 0.000 0.185 0.000 {map}
229899 0.067 0.000 0.125 0.000 set.py:634(__iter__)
6334 0.067 0.000 2.223 0.000
set_partition_ordered.py:388(__iter__)
17881 0.067 0.000 6.441 0.000
set_partition.py:374(<lambda>)
170189 0.064 0.000 0.132 0.000 set.py:158(is_Set)
}}}
The worst change in cumulative time (it would probably be better to sort
the profile data on that to see which part of the code is responsible -
after that you can see which callees from that code use much time) seem to
be in
{{{
set_partition.py:221(_iterator_part)
set.py:603(__init__)
}}}
but not that the NUMBER of calls here isn't much different, so it doesn't
look like we're creating parents that much more often here (that would
always show up in python profiles, right?)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13400#comment:22>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.