Opened 5 years ago

Closed 5 years ago

#28686 closed Cleanup/optimization (invalid)

QuerySet.bulk_create() doesn't need to convert the input objs into list

Reported by: Michael Lee Owned by: nobody
Component: Database layer (models, ORM) Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I checked and found that in this commit,

The objs are converted to list. But if objs is actually a huge generator, then possibly the performance would be hugely degraded ?

Maybe we could simply remove the the list conversion ?

Change History (1)

comment:1 Changed 5 years ago by Tim Graham

Component: UncategorizedDatabase layer (models, ORM)
Resolution: invalid
Status: newclosed

Without the list() call, generators no longer work properly. Try running Django's test suite and you'll see some test failures. Feel free to reopen the ticket if you can provide a patch that passes the tests.

Note: See TracTickets for help on using tickets.
Back to Top