User talk:Porplemontage: Difference between revisions

Line 347: Line 347:


I've been working on one of the trophy templates to expand its functionality and I noticed that one method (with no nested if-statements) has a higher "preprocessor visited node count" but significantly lower "post-expand include size" compared to another method (with nested if-statements). When used 58 times: preproc: 14,648 (current) vs 16,618 (method 1) vs 16,150 (method 2); post-expand: 280,460 (current) vs 306,023 (method 1) vs 382,466 (method 2)). My question is: should I prioritize reducing one value more than the other? Or any of the other values in the profiling data? Between the two, the "CPU time usage" deviates within 0.08 seconds and the resulting HTML difference is less than 100 bytes. --[[User:CanvasK|CanvasK]] ([[User talk:CanvasK|talk]]) 08:13, September 8, 2022 (EDT)
I've been working on one of the trophy templates to expand its functionality and I noticed that one method (with no nested if-statements) has a higher "preprocessor visited node count" but significantly lower "post-expand include size" compared to another method (with nested if-statements). When used 58 times: preproc: 14,648 (current) vs 16,618 (method 1) vs 16,150 (method 2); post-expand: 280,460 (current) vs 306,023 (method 1) vs 382,466 (method 2)). My question is: should I prioritize reducing one value more than the other? Or any of the other values in the profiling data? Between the two, the "CPU time usage" deviates within 0.08 seconds and the resulting HTML difference is less than 100 bytes. --[[User:CanvasK|CanvasK]] ([[User talk:CanvasK|talk]]) 08:13, September 8, 2022 (EDT)
:I would say that reducing CPU time usage is ultimately best, but that value will vary a certain percentage on every parse. In this case the difference seems insignificant, so I would just go with whichever syntax you like better. --[[User:Porplemontage|Porplemontage]] ([[User talk:Porplemontage#top|talk]]) 11:19, September 8, 2022 (EDT)