Ticket #39 (closed defect: wontfix)

Opened 5 years ago

Last modified 5 years ago

Bad list constructor code

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

Description

Consider:

 405:     _operands = list()

  __pyx_1 = PyObject_Call(((PyObject*)&PyList_Type), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1;}
  Py_DECREF(__pyx_v__operands);
  __pyx_v__operands = __pyx_1;
  __pyx_1 = 0;

This is wildly inefficient compared to a single PyList?_New(0) call.

Change History

Changed 5 years ago by robertwb

  • priority changed from major to trivial

Use

_operands = []

instead.

Changed 5 years ago by robertwb

  • milestone set to wishlist

Changed 5 years ago by robertwb

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

Changed 5 years ago by robertwb

  • milestone changed from wishlist to 0.10
Note: See TracTickets for help on using tickets.