Opened 11 years ago

Closed 11 years ago

#19523 closed Cleanup/optimization (fixed)

improve performance of django's bash completion

Reported by: Raphaël Hertzog Owned by: nobody
Component: Core (Management commands) Version: 1.4
Severity: Normal Keywords:
Cc: andersk@…, luke@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In http://bugs.debian.org/695811 Anders Kaseorg <andersk@…> reported that the usage of the basename command was severly impacting the performances of Django's bash completion script.

The attached patch gets rid of "basename" in favor of some bash internal pattern substitution and improves the perfornance by a factor of 5 according to its author.

Attachments (1)

patch (1.4 KB ) - added by Raphaël Hertzog 11 years ago.
Patch to get rid of basename in Django's bash completion

Download all attachments as: .zip

Change History (5)

by Raphaël Hertzog, 11 years ago

Attachment: patch added

Patch to get rid of basename in Django's bash completion

comment:1 by Luke Faraone, 11 years ago

Cc: luke@… added

comment:2 by Aymeric Augustin, 11 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Aymeric Augustin, 11 years ago

Component: UncategorizedCore (Management commands)

comment:4 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: newclosed

In e535da6865f0e02f0b593b52ed2e040b24a886d6:

Fixed #19523 -- Improved performance of Django's bash completion

Previous version took about 150ms to source, even on a warm cache,
primarily because it forks+execs /usr/bin/basename 44 times.
This patch makes it faster by a factor of 5 (and I imagine that a little
more thought would reduce the time to effectively zero).

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