Commit 39b3e6e
committed
[miq_provision_virt_workflow.rb] Use VmOrTemplate#platform
Very large performance improvement from this patch on large collections
of templates since it avoids preloading all together, reducing the
number of iterations over the VM collection, and the number of support
objects needing to be introduced (that would later need to be garbage
collected.
Benchmark
---------
**Before**
| ms | queries | query (ms) | rows |
| ---: | ---: | ---: | ---: |
| 27107 | 33 | 1958.5 | 243133 |
| 26803 | 33 | 1944.2 | 243133 |
| 27642 | 33 | 1965.5 | 243133 |
**After**
| ms | queries | query (ms) | rows |
| ---: | ---: | ---: | ---: |
| 14344 | 33 | 1759.6 | 243133 |
| 14631 | 33 | 1729.0 | 243133 |
| 13405 | 33 | 1752.3 | 243133 |1 parent 871f2b8 commit 39b3e6e
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
302 | 308 | | |
303 | 309 | | |
304 | 310 | | |
| |||
355 | 361 | | |
356 | 362 | | |
357 | 363 | | |
358 | | - | |
359 | 364 | | |
360 | 365 | | |
361 | 366 | | |
| |||
1055 | 1060 | | |
1056 | 1061 | | |
1057 | 1062 | | |
1058 | | - | |
| 1063 | + | |
1059 | 1064 | | |
1060 | 1065 | | |
1061 | 1066 | | |
| |||
0 commit comments