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

Erubi Support #2089

Closed
adam12 opened this issue Nov 12, 2016 · 6 comments
Closed

Erubi Support #2089

adam12 opened this issue Nov 12, 2016 · 6 comments

Comments

@adam12
Copy link
Contributor

adam12 commented Nov 12, 2016

I think it would be worth considering support for Erubi, either in addition or in replacement of Erubis. I won't go into the benefits of Erubi - Jeremy Evans does a great job in the README.

I ran some benchmarks using my code here: https://gist.github.com/adam12/8c3613d0c9ba6ebddc8eb8a962b36323

In summary:

  • Erubis vs Erubi performance fairly comparable.
  • Memory usage of Erubi is indeed 90% lower (per claim in Erubi README).
  • Jeremy is known to be an excellent OSS maintainer.

(the following tests run with ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15])

Performance Benchmark

Comparison:
1k fast erubis    (eval):        3.4 i/s
1k erubis         (eval):        3.2 i/s - 1.04x  slower
1k erb            (eval):        3.1 i/s - 1.08x  slower
1k erubi          (eval):        2.7 i/s - 1.22x  slower
1k erubi  (compile+eval):        2.1 i/s - 1.58x  slower
1k erubis (compile+eval):        2.1 i/s - 1.61x  slower
1k erb    (compile+eval):        1.9 i/s - 1.76x  slower

Memory Benchmark

Some data removed for brevity

allocated memory by gem
-----------------------------------
    102227  erubis-2.7.0
     15992  erubi-1.0.0

allocated objects by gem
-----------------------------------
       908  erubis-2.7.0
       181  erubi-1.0.0

retained memory by gem
-----------------------------------
     50999  erubis-2.7.0
      2528  erubi-1.0.0

retained objects by gem
-----------------------------------
       154  erubis-2.7.0
         8  erubi-1.0.0

I'd be willing to submit a PR should this be of interest.

@ujifgc
Copy link
Member

ujifgc commented Nov 12, 2016

Yes, you are welcome to submit a PR.

@wikimatze
Copy link
Member

@adam12 do you want to implement the support for this?

@adam12
Copy link
Contributor Author

adam12 commented Nov 13, 2016

@wikimatze I'm going to explore adding it, yes.

@wikimatze
Copy link
Member

Perfect, looking forward to your contribution.

@fidalgo
Copy link
Contributor

fidalgo commented Feb 16, 2017

Actually Rails is moving to Erubi also: rails/rails#27757

@ujifgc
Copy link
Member

ujifgc commented Mar 13, 2017

Implemented in #2090

@ujifgc ujifgc closed this as completed Mar 13, 2017
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

4 participants