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

Further performance improvements. #3022

Merged
merged 14 commits into from Oct 24, 2014
Merged

Further performance improvements. #3022

merged 14 commits into from Oct 24, 2014

Conversation

parkr
Copy link
Member

@parkr parkr commented Oct 22, 2014

Wow, we wrote a lot of slow code here.

I just couldn’t believe this but look:

~/jekyll/jekyll#master$ ruby benchmark/string-concat
Calculating -------------------------------------
                  +=      6367 i/100ms
                  <<    128697 i/100ms
-------------------------------------------------
                  +=     1704.3 (±0.6%) i/s -      12734 in   7.472170s
                  <<  4381212.4 (±6.3%) i/s -   21878490 in   5.014899s

WOW.
Calculating -------------------------------------
 fetch with no block     66979 i/100ms
  fetch with a block    138257 i/100ms
 brackets with an ||    145792 i/100ms
-------------------------------------------------
 fetch with no block  1255521.2 (±5.2%) i/s -    6296026 in   5.028856s
  fetch with a block  6402972.5 (±8.1%) i/s -   31799110 in   5.002554s
 brackets with an ||  8536511.4 (±8.1%) i/s -   42425472 in   5.005831s
Calculating -------------------------------------
               block      5403 i/100ms
              &:to_s      6094 i/100ms
-------------------------------------------------
               block    60023.4 (±5.3%) i/s -     302568 in   5.055537s
              &:to_s    59047.0 (±4.9%) i/s -     298606 in   5.068991s
Calculating -------------------------------------
               yield     70018 i/100ms
          block.call     42809 i/100ms
-------------------------------------------------
               yield  1099624.2 (±7.3%) i/s -    5531422 in   5.056107s
          block.call   604006.1 (±7.1%) i/s -    3039439 in   5.058794s
Calculating -------------------------------------
.map.flatten with nested arrays
                          4718 i/100ms
.flat_map with nested arrays
                          6048 i/100ms
.map.flatten with no nested arrays
                          9804 i/100ms
.flat_map with no nested arrays
                          9302 i/100ms
-------------------------------------------------
.map.flatten with nested arrays
                        48118.3 (±4.8%) i/s -     240618 in   5.011942s
.flat_map with nested arrays
                        63838.6 (±5.1%) i/s -     320544 in   5.034864s
.map.flatten with no nested arrays
                       104879.3 (±4.4%) i/s -     529416 in   5.057802s
.flat_map with no nested arrays
                        99935.3 (±6.6%) i/s -     502308 in   5.049506s
Calculating -------------------------------------
                 #tr     62416 i/100ms
               #gsub     33750 i/100ms
              #gsub!     29695 i/100ms
                #sub     60774 i/100ms
               #sub!     64955 i/100ms
-------------------------------------------------
                 #tr   989348.8 (±5.0%) i/s -    4993280 in   5.060836s
               #gsub   422892.9 (±4.3%) i/s -    2126250 in   5.037741s
              #gsub!   364115.6 (±4.0%) i/s -    1841090 in   5.064496s
                #sub   964336.6 (±4.4%) i/s -    4861920 in   5.051775s
               #sub!  1016598.5 (±4.7%) i/s -    5131445 in   5.058987s
Calculating -------------------------------------
 parallel assignment    126425 i/100ms
multi-line assignment
                        136492 i/100ms
-------------------------------------------------
 parallel assignment  6382145.2 (±10.1%) i/s -   31606250 in   5.006184s
multi-line assignment
                      9281041.8 (±11.7%) i/s -   45724820 in   5.001599s
parkr added a commit that referenced this pull request Oct 24, 2014
@parkr parkr merged commit 578f387 into master Oct 24, 2014
@parkr parkr deleted the perf branch October 24, 2014 18:34
parkr added a commit that referenced this pull request Oct 24, 2014
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants