Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2388 (closed enhancement: migrated)

Opened 5 years ago

Last modified 4 years ago

Implement lazy loading of template engine plug-ins

Reported by: Chris Arndt Owned by: chrisz
Priority: normal Milestone: 1.5
Component: View Version: 1.1 HEAD
Severity: minor Keywords: view, buffet, temlate engine, migrate
Cc:

Description (last modified by Chris Arndt) (diff)

Currently Buffet template engines are loaded in view.load_engines() when the TurboGears server starts up. This means that all template engine plugins, which are registered through an entry point are loaded and instantiated, whether they are used by the application or not.

We should investigate if it's feasible to instantiate a template plugin only when it is first needed. view.load_engines would then only collect a list of available plugins and set some default engine options. Instantiating the plugin and loading options would then only be triggered from view.render.

This would prevent bad plugins, which are installed but not used in the application, from causing it too fail on startup. Exceptions in the startup phase currently cause TG/CherryPy to hang when the autoreloader is active.

I may also speed up start-up time a bit.

Change History

comment:1 Changed 5 years ago by Chris Arndt

  • Description modified (diff)

comment:2 in reply to: ↑ description Changed 5 years ago by chrisz

Replying to Chris Arndt:

I may also speed up start-up time a bit.

Which is a really important issue during development. So I'm +1 on this. I'm not sure how much we will gain by this, but it's worth a try.

comment:3 Changed 4 years ago by Chris Arndt

  • Owner changed from Chris Arndt to chrisz
  • Keywords engine, migrate added; engine removed

Nothing has been done in this department yet. I think this ticket should be migrated.

comment:4 Changed 4 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to migrated
Note: See TracTickets for help on using tickets.