Edgewall Software

Changes between Version 38 and Version 39 of TracDev/Proposals/Jinja


Ignore:
Timestamp:
Feb 25, 2023, 11:29:19 AM (14 months ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/Proposals/Jinja

    v38 v39  
    99A bit of history first...
    1010
    11 Trac started its life in 2005 as a very reactive web application, as the page content was generated with ClearSilver, a template engine written in C. However, as fast as it was, it had serious quirks, troubleshooting errors was quite difficult, installation on Windows was problematic, etc. Enters Genshi in 2006, which proved to be way more flexible, and more convenient to develop with. It was also way slower, but we were confident that this would eventually improve. Trac has been converted to use Genshi for the 0.11 release (2008), and we're using it ever since.
     11Trac started its life in 2005 as a very reactive web application, as the page content was generated with ClearSilver, a template engine written in C. However, as fast as it was, it had serious quirks, troubleshooting was onerous, installation on Windows was problematic, etc. Enter Genshi in 2006, which proved to be way more flexible, and more convenient to develop with. It was also way slower, but we were confident that this would eventually improve. Trac has been converted to use Genshi for the 0.11 release (2008), and was used for subsequent releases.
    1212
    13 While we managed to keep Genshi memory usage somewhat in control (#6614), the speed was never really adequate, especially for big changesets and for displaying source files over a few thousand lines of code (see TracDev/Performance#Genshi for details). The maintenance of Genshi itself has often proved to be problematic to work with, and some issues remain unsolved (#11184).
     13While we managed to keep Genshi memory usage somewhat in control (#6614), the speed was never really adequate, especially for big changesets and for displaying source files over a few thousand lines of code (see TracDev/Performance#Genshi for details). The maintenance of Genshi itself has often proved to be problematic, and some issues remain unsolved (#11184).
    1414
    15 Hence the proposal to look into an alternative template engine. Jinja2 had always looked like a very serious candidate. Kajiki was briefly considered, but while the performance was on par with Jinja2, it was not mature enough (see [7acf61ba/cboos.git]). As Jinja2 seemed to hold all its promises (see [7d4b6f84/cboos.git]), the migration effort started in this direction beginning of 2016.
     15Hence the proposal to look into an alternative template engine. Jinja2 had always looked like a very serious candidate. Kajiki was briefly considered, but while the performance was on par with Jinja2, it was not mature enough (see [7acf61ba/cboos.git]). As Jinja2 seemed to hold all its promises (see [7d4b6f84/cboos.git]), the migration effort started in beginning of 2016.
    1616
    17 Besides, the Jinja2 template engine has the peripheral benefit of being used by the Django community: [gmessage:trac-dev/KqWPQWuZ63k/GPfda0_PDgAJ].
     17Also, the Jinja2 template engine has the peripheral benefit of being used by the Django community: [gmessage:trac-dev/KqWPQWuZ63k/GPfda0_PDgAJ].
    1818
    1919
     
    4040 * open issues: [[TicketQuery(keywords=~jinja,status=!closed)]]
    4141
    42 See also [googlegroups:trac-dev:fc8d8c0447140110 this Trac-Dev discussion] from 2010, which is still pertinent. While we managed to release Genshi 0.6 since then, the issue is a recurring one, see this recent (2016-01)
    43 [gmessage:trac-users:PYqQ4UDRnl8/wg8lQzrGDAAJ Genshi question] on Trac-Users.
     42See also [googlegroups:trac-dev:fc8d8c0447140110 this Trac-Dev discussion] from 2010, which is still pertinent. While we managed to release Genshi 0.6 since then, the issue is a recurring one, see this recent (2016-01) [gmessage:trac-users:PYqQ4UDRnl8/wg8lQzrGDAAJ Genshi question] on Trac-Users.
    4443
    45 The topic is now (Feb / March 2016) again discussed on [gdiscussion:trac-dev:KqWPQWuZ63k trac-dev].
     44The topic is again discussed on [gdiscussion:trac-dev:KqWPQWuZ63k trac-dev] (Feb / March 2016).
    4645
    4746== Experimenting with Jinja2 (2.8)
     
    7675 - TTFB (Time to first byte), as given by Chrome network panel in the developer window
    7776 - CD (Content download), idem
    78  - Rdr (template rendering time), mostly significant for the "blob" method otherwise it also takes the network latency into account
     77 - Rdr (template rendering time), mostly significant for the "blob" method, otherwise it also takes the network latency into account
    7978
    8079All values are given in milliseconds.