id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,work_issues,upstream,reviewer,author,merged,dependencies,stopgaps
11342,Make getattr faster on parents and elements,SimonKing,,"If an attribute of a parent or element can not be found by inspecting the method resolution order, `__getattr__` is invoked. It tries to obtain the attribute from the parent class or the element class of the category of the parent. If it can not be found, the attribute error is raised using a Cython function `sage.structure.parent.raise_attribute_error`.

I see several ways to make both `__getattr__` and `sage.structure.parent.raise_attribute_error` a lot faster. Details will be given in the comments.

Because of one doctest in `sage.categories.primer`, it is needed that the category of polynomial rings is properly initialised. Therefore:

Depends on #9944

Apply 

 * [attachment:trac11342-attribute_error_message.rebased.patch]
 * [attachment:trac_11342_fix_pari_initialization.patch]
 * [attachment:trac_11342_fix_pari_ring.patch]
 * [attachment:trac_11342_crypto_fixes.patch]
 * [attachment:trac11342_test_parent_on_getattr.patch]
",enhancement,closed,major,sage-4.7.2,performance,fixed,getattr parent element,jdemeyer,,N/A,"Jeroen Demeyer, Volker Braun, Simon King","Simon King, Volker Braun",sage-4.7.2.alpha3,#9944,
