Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Cache interpolator methods and reduce memory allocations - rebased #2054

Closed

Conversation

dgynn
Copy link
Contributor

@dgynn dgynn commented Nov 16, 2015

This is a rebased PR of #1888 in case that one does not merge cleanly to master (although it should).

dgynn and others added 8 commits November 16, 2015 10:58
by using the attachment name (symbol) and Class as keys we reduce the number of Strings created before hitting the cache
this commit primarily uses frozen strings to reduce object creation during interpolation.
the :basename method now uses File.basename(file, ".*") rather than a Regexp. basename may be called multiple times.
the name string is used multiple times in interpolation so storing it reduces object creation
end

it 'pluralizes and underscore words' do
it 'pluralizes and underscore class names' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@dgynn
Copy link
Contributor Author

dgynn commented Nov 19, 2015

Closing since v4.3 was merged in directly.

@dgynn dgynn closed this Nov 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants