Template talk:Michelin stars

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
WikiProject iconFood and drink Template‑class
WikiProject iconThis template is within the scope of WikiProject Food and drink, a collaborative effort to improve the coverage of food and drink related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
TemplateThis template does not require a rating on Wikipedia's content assessment scale.
Food and Drink task list:
To edit this page, select here

Here are some tasks you can do for WikiProject Food and drink:
Note: These lists are transcluded from the project's tasks pages.

Michelin stars in gif or in svg?[edit]

Copied from User talk:The Banner, -DePiep (talk) 14:16, 28 October 2014 (UTC)[reply]

The question is whether the stars should be in svg or in gif format. THis talk followed:

From Parser profiling data:

gif1
CPU time usage 19.537 seconds
gif2
CPU time usage 14.617 seconds
gif 3
CPU time usage 16.725 seconds
svg1 (2587 replacements)
CPU time usage 17.013 seconds
svg 2
CPU time usage 19.785 seconds
svg 3
CPU time usage 19.245 seconds


From this, I conclude that the page loads very slow indeed. That is, only once, right after an edit; and in every preview; after that every loading or page opening for reading is fast. However, I see no big difference between gif and svg. So the slow loading is not caused by the gif/svg difference. (If I miss something so far, please tell me).

That says that we can switch to svg files without causing this problem. And since svg is preferred, we should do so. (Of course, the page can use a good check for other issues).

Another problem from your edit is that from this one article, the template would be restricted for all articles. That means that the article causes the problem and spreads it, not the template. And so that must be solved in or through that article.

I propose to use the svg files in the template, and --independently-- look for improvements in the article. What do you think? -DePiep (talk) 09:52, 28 October 2014 (UTC)

I use that article quite often, as base for the articles about restaurants. I noticed a severe deterioration in loading times down here. That is why I am very reluctant to the change. But, that is not a 100% no.
Another thing is style of the etoile. Yours is very thin and has a rather bleak appearance. Perhaps you can change that a little (giving it more "body").
Then the question of how to use it. I think the easiest option will be to develop a second template. The present one, used in the "normal" articles can be altered to use the SVG. The new one, used in the list/overview articles like List of Michelin starred restaurants in the Netherlands, List of Michelin starred restaurants in Ireland and the list of Great-Britain that is still on my wish list, can use the GIF.
Perhaps not the best solution technically, but I think the most workable. (By the way, I have not a clue why SVG is preferred, although I have heard about this preference before.) The Banner talk 11:03, 28 October 2014 (UTC)
Good plan to make that second template for gifs, isolates the psossible issue. I'll start that, and report here. btw, I do not think that speeds up the page (as the tests indicate), but if you think it useful I'm fine with that.
svg, in general, is better scalable (finer lines & color-borders in every size).
'More body' = thicker lines in the scg you mean? will look into that, later on. -DePiep (talk) 11:28, 28 October 2014 (UTC)
Indeed, a bit thicker lines. Good for people with less than perfect eyesight. The Banner talk 11:33, 28 October 2014 (UTC)
I see, now both in one page: template:Michelin stars/testcases. Will take care after the name split. -DePiep (talk) 12:31, 28 October 2014 (UTC)
End of quote. -DePiep (talk) 14:16, 28 October 2014 (UTC)[reply]
Pff, that name change massively backfires. Suddenly the article is 20kB bigger... The Banner talk 18:36, 28 October 2014 (UTC)[reply]
Squeezed out as much as I could and renamed it to "Michelinstar gif". After a replacement, the list was reduced by 10kB... The Banner talk 18:44, 28 October 2014 (UTC)[reply]
I disagree with the name change, because it is not relevant for the speed issue, and the " (gif)" name is correct for disambiguation.
Yes, 20k bigger. But don't start worrying that it is about the speed issue. They are just 20k characters, not extra links or so. Where do these 20k come from? Old template name: "Michelinstar" (12 chars), new name "Michelin stars (gif)" (20 chars, plus 8). This for all 2587 templates in the text, makes {{{1}}} extra characters. No extra links or so. -DePiep (talk) 19:11, 28 October 2014 (UTC)[reply]
A lot of people with mobile internet pay per gigabyte, so it is useful to think about them too. The Banner talk 19:17, 28 October 2014 (UTC)[reply]
(editconflict) The redirects for {{Michelin stars (gif)}} are a mess now. Documentation is lost. I don't feel invited to clean up. As long as this does not spoil into {{Michelin stars}}, do as you like. If the new situation were clean & correct, I would have made suggestions in the sandbox (like hardcoding the sort code). -DePiep (talk) 19:19, 28 October 2014 (UTC)[reply]
  • The banner, I think I'm gonna revert that template move. Saving characters is useless as I mentioned (and see also Wikipedia:Article size, for example section WP:SIZERULE. You are on the wrong track trying to reduce page size this way. (also, I don't like a good name being cut too short).
Other routes we could follow to improve the page:
1. Remove double links per table. For example, Amsterdam only needs one link per table, not every time mentioned.  Done: repetitions unlinked now.
2. Hardcode sort template (now in {{michelinstar (gif)}} as {{sort|...}}, which is an extra step).
maybe more. -DePiep (talk) 19:40, 28 October 2014 (UTC)[reply]
The Banner: I have removed the sort-template from the {{Michelinstar gif}} template altogether. (that is, {{sort}}). So in the resulting page, there will be much less code.
parser numbers
CURRENT PAGE
Parser profiling data:
CPU time usage	14.101 seconds
Real time usage	17.000 seconds
Preprocessor visited node count	25092/1000000
Preprocessor generated node count	52729/1500000
Post-expand include size	273738/2048000 bytes
Template argument size	2705/2048000 bytes
Highest expansion depth	9/40
Expensive parser function count	3/500
Lua time usage	0.412/10.000 seconds
Lua memory usage	3 MB/50 MB

YESTERDAYS TEST
Parser profiling data:
CPU time usage  19.537 seconds
Real time usage 22.049 seconds
Preprocessor visited node count 45898/1000000
Preprocessor generated node count       63722/1500000
Post-expand include size        1059813/2048000 bytes
Template argument size  106447/2048000 bytes
Highest expansion depth 9/40
Expensive parser function count 3/500
Lua time usage  0.300/10.000 seconds
Lua memory usage        2.93 MB/50 MB

Before: Post-expand include size 1059813/2048000 bytes After: Post-expand include size 273738/2048000 bytes

Or, the loaded page has gone from 1059kB to 273kB! (the {{sort}} code is not there, times 2587!). Still, the table sorts OK by star number (with me; please check). I think this is a good result. -DePiep (talk) 21:27, 28 October 2014 (UTC)[reply]

Hmmm, to be true I hardly understand what you have done. But I see a massive, massive, massive improvement in loading times. So yes, I love your change! The Banner talk 21:49, 28 October 2014 (UTC)[reply]
Great. Sorting works well too then?
Template {{sort}} was in the {{Michelinstar gif}} template. It adds code to make them columns sort by number 1, 2, 3 of stars. These sort numbers are invisible. The resulting code is like this for 3-stars:
<span style="display:none;" class="sortkey">3 </span><span class="sorttext">[[File:Michelin-3.gif|14px]]</span>
The "3" sorts, the file shows the stars.
Now, if we leave out the sort code, the column will be
[[File:Michelin-3.gif|14px]]
And this shows the file, and it sorts by filename: 1-2-3 is OK too.
So I removed that {{sort}} from the gif template and now that code is not added (2587 times). That's the speed win. I guess. -DePiep (talk) 23:29, 28 October 2014 (UTC)[reply]
It looks like it. The Banner talk 23:56, 28 October 2014 (UTC)[reply]