Ticket #37 (closed defect: invalid)

Opened 5 years ago

Last modified 5 years ago

Casting is slow because of TypeCheck Call

Reported by: gfurnish Owned by: somebody
Priority: major Milestone:
Component: Optimization Keywords:
Cc:

Description

For instance, consider:

 149:                 top = (<SymbolicPowArithmetic>x)._operands[1]

        __pyx_1 = __Pyx_GetItemInt(((PyObject *)((struct __pyx_obj_4sage_9symbolics_9operators_10arithmetic_SymbolicPowArithmetic *)__pyx_v_x)->__pyx_base.__pyx_base.__pyx_base._operands), 1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1;}
        if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_4sage_9symbolics_10expression_TypedSymbolicExpression))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1;}
        Py_DECREF(((PyObject *)__pyx_v_top));
        __pyx_v_top = ((struct __pyx_obj_4sage_9symbolics_10expression_TypedSymbolicExpression *)__pyx_1);
        __pyx_1 = 0;

There needs to be a way to cast without the Py_TypeCheck call inside of the cast. I spend more time in sage-symbolics in TypeChecks? then actually computing things. This is a critical problem, because in almost all cases I know that I can bypass this check.

Change History

Changed 5 years ago by anonymous

  • status changed from new to closed
  • resolution set to invalid

Nevermind, this is me (misreading) the source code. Sorry

Note: See TracTickets for help on using tickets.