Project

General

Profile

Bug #23608

ENC with smart class parameters is slow (regression with 1.16)

Added by Bastian Blank about 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

If a host uses a lot of smart class parameters (50+), running the ENC gets awful slow. Runtimes of 10 or more seconds have been reported. The runtime grows linear with the number of parameters.

Classification::ValuesHashQuery#values_hash is used to retrieve all the parameters used in the ENC. For each key this method calls lookup_values_cache with the same parameters. The called method assembles a database query, which is pretty slow, even if it never shows up in the ActiveRecord time and just runs against the cache.

The simple fix just calculates the result of lookup_values_cache once.

However I'm not sure if this code is even correct now, as different parameters can have different orders.

Associated revisions

Revision a538c9b5 (diff)
Added by Bastian Blank 12 months ago

Fixes #23608 - Only calculate lookup values once

History

#1 Updated by The Foreman Bot about 1 year ago

  • Pull request https://github.com/theforeman/foreman/pull/5583 added

#2 Updated by The Foreman Bot 12 months ago

  • Status changed from New to Ready For Testing

#3 Updated by Anonymous 12 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#4 Updated by The Foreman Bot 12 months ago

  • Assignee set to Michael Moll
  • Pull request https://github.com/theforeman/foreman/pull/5602 added

#5 Updated by Marek Hulán 12 months ago

  • Legacy Backlogs Release (now unused) set to 359

#6 Updated by Ewoud Kohl van Wijngaarden 10 months ago

  • Triaged set to No
  • Found in Releases 1.16.1 added
  • Fixed in Releases 1.16.2, 1.17.2 added

Also available in: Atom PDF