googlefonts / glyphsLib

A bridge from Glyphs source files (.glyphs) to UFOs
Apache License 2.0
181 stars 51 forks source link

Remove very slow code that does nothing #922

Closed khaledhosny closed 1 year ago

khaledhosny commented 1 year ago

It is iterating over all masters in the font, then tries to access the master by its id and then checks if the master is None, but this can never happen since we are iterating over already existing masters.

This code is called in a very hot spot, and in a script I’m profiling, it takes more than 50% of the font build time.

Fixes https://github.com/googlefonts/glyphsLib/issues/646

schriftgestalt commented 1 year ago

I think the code would make some sense when it would iterate over the masters and checks for layers but as discussed not be issue, that is not really needed.