-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid loading samples when Classifier isn't used (#4540)
samples.json is a very large (3.7M) json file, which allocates 183209 ruby strings, which takes 8.2MB of memory according to memsize_of. Instead of keeping the cache around when loading language.rb, we can instead just load the JSON and allow it to be GC'd after we use it. Cache will still be used if the Classifier is invoked.
- Loading branch information
Showing
2 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters