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

Enable frozen string literals #1108

Open
tagliala opened this issue Jun 28, 2024 · 0 comments
Open

Enable frozen string literals #1108

tagliala opened this issue Jun 28, 2024 · 0 comments

Comments

@tagliala
Copy link
Contributor

Hi,

I'm checking the effects of enabling frozen string literals on Money gem

The WIP is here: tagliala#2

Money#format method is the one that will get the greater improvement

Test on M1 Pro, x86 Ruby, 3.3.2

Before

benchmark

                                     user     system      total        real
README Examples                  1.685944   0.001231   1.687175 (  1.689099)
Money#from_cents                 0.116858   0.000079   0.116937 (  0.117140)
Money#format                     1.157583   0.001087   1.158670 (  1.163761)

profile_memory

Total allocated: 280728 bytes (3531 objects)
Total retained:  800 bytes (8 objects)

allocated memory by gem
-----------------------------------
    268728  money/lib
     12000  other

After

benchmark

README Examples                  1.670620   0.001191   1.671811 (  1.675098)
Money#from_cents                 0.115541   0.000104   0.115645 (  0.115857)
Money#format                     1.133997   0.000903   1.134900 (  1.138368)

profile_memory

Total allocated: 265128 bytes (3171 objects)
Total retained:  800 bytes (8 objects)

allocated memory by gem
-----------------------------------
    253128  money/lib
     12000  other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant