Project

General

Profile

Actions

Bug #34938

closed

don't re-evaluate TemplateInputs on every loop iteration

Added by Evgeni Golov almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Reporting
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When iterating over a big list of hosts (with load_hosts().each_record do |host| or similar), it is rather expensive to call input() inside the loop, as that hits the database every time.

For example, rendering the Ansible Inventory report with 3500 hosts, hits the DB with 35000 TemplateInput Loads (10× per host!).

Actions #1

Updated by The Foreman Bot almost 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/9223 added
Actions #2

Updated by The Foreman Bot almost 2 years ago

  • Fixed in Releases 3.4.0 added
Actions #3

Updated by Evgeni Golov almost 2 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF