evazion / translate-pixiv-tags

MIT License
35 stars 6 forks source link

Memoized more functions #40

Closed BrokenEagle closed 4 years ago

BrokenEagle commented 4 years ago

I could have also memoized the timeToAgo and formatBytes, but I considered it unlikely that there would ever be an instance where they would get the same parameters.

@7nik I was also thinking that the menu created by showSettings could be kept in memory like the artist qTips are instead of being built each time the settings menu gets called, but I'll leave that to a separate PR/commit. You can do it if you want, or I can do it if you want me to.

BrokenEagle commented 4 years ago

As per the conversation with @7nik on Discord, I removed the memoized noIndent function and instead added caching to the artist and translated tag elements.