Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Funsubs precalculation should be done once and optimize regex searches #49

Open
JimTheCactus opened this issue Sep 16, 2015 · 2 comments

Comments

@JimTheCactus
Copy link
Owner

Gummy currently does the matrix inversion on the funsubs data on load and once an hour. On top of that, gummy currently uses a for loop to test each of the possible substitutions. This is inefficient as it means running through the string multiple times.

The best approach would be to precalculate the funsubs only once and precompile a single regex that finds the various funsubs. This would speed up the calculation and reduce wasted overhead.

@JimTheCactus
Copy link
Owner Author

JimTheCactus added a commit that referenced this issue Sep 17, 2015
This was referenced Sep 17, 2015
@JimTheCactus
Copy link
Owner Author

One thing worth looking at is to create a cache folder with the computed classes. When a file is needed in a given line, it checks a memory cache to see if that file has already been loaded. If not, the lines are loaded (maybe it's time to grab File::Slurp?) and the cache is held in memory until the line is finished so %pony, %pony, %pony doesn't load the pony file 3 times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant