We're having an issue where memory usage for our build process tops out at 2GB. This is because of a couple concurrent tasks. I've pinpointed the usage to icons.scss, specifically this piece of code. Seems like nth is the culprit here. Memory usage when compiling this file goes from anywhere between 300-750mb. If I disable the loop, it uses 60mb at most. I'm not really sure if there are any other specifics, but if I use an object instead of two arrays, the memory usage stays much lower. We're using node 4.2.2 w/ node-sass 3.7.0, via gulp-sass.
I think moving to a map would be a viable solution. We have plans to break the icon list into it's own file separate from the helper function. What syntax are you seeing most performant on memory.
Version 3.3.0 (7 March 2014) added map support so I think we're at a time where this is a viable addition.
Amen to the splitting out of the helper function and CSS generation. We've run into issues where we want to have the helper function but not the CSS. Would you be open to a pull request doing both these things?
Yea, would definitely take a pull request for this issue. It's on my to do list for the next release, so it would help a lot.
@plestik Actually, don't submit a pull request, it will eventually be rejected since those files are auto generated. If you want to paste it in here as a comment it might be easier. Just need an idea of how you were expecting it to look.
@Templarian here's what works for me: https://gist.github.com/plestik/b6041f0f47d09835b34e2c9310fe5fa1. Splitting out the helper function seems obvious to me, so didn't include that change.
Looks good to me. This will be in the next release by the way once I get some time.
By the way splitting out the icons is part of issue #961, so I remember to close it also.
Great, let me know if you need any help. I'm using a fork for now to prevent deploy issues.
I'm going to be moving new map $mdi-icons: (); to the _variables.scss file. The _icons.scss file will contain the loop. Functions will be found in the _functions.scss file.
Please let me know if this all makes sense. Aiming for a Sunday release (unless I keep playing Doom).
/cc @CoDEmanX and @gligoran for a review.
All the 1.6.50 icons are in. The code changes for the above are complete. Yep, on schedule for the 1.6.50 release tomorrow.
//edit, https://cdn.materialdesignicons.com/1.6.50-dev/ CDN dev branch is also up.
@Templarian: excellent, thanks for the quick work!
This was resolved in v1.6.50 that went out an hour or so ago. Thanks for the help!