Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#16971 closed Cleanup/optimization (fixed)

Speed-up for jslex used during makemessages for Javascript files.

Reported by: nedbatchelder Owned by: nobody
Component: Internationalization Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The JsLex lexer introduced in [16333] has a fairly slow inner loop, because of the string truncation used as tokens are consumed.

Antti Haapala (antti@…) contributed a much tighter implementation of the inner loop:

This applies that same patch to the Django code.

Attachments (1)

jslex-speedup.patch (1.7 KB) - added by nedbatchelder 5 years ago.
The patch!

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by nedbatchelder

The patch!

comment:1 Changed 5 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 5 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from new to closed

In [16924]:

Fixed #16971 - Made the parsing of javascript files by 'makemessages' much faster. Thanks Antti Haapala for the implementation and Ned Batchelder for the patch.

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