Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Feb 11, 2015
  1. @eileencodes

    Reduce object allocations in Rack::Utils

    eileencodes authored
    Using AllocationTracer we were able to find unnecessary allocations of
    objects.
    
    1) `[]=` is duping the hash key object on assignment. Frezing
    `k.downcase` will prevent this.
    
    2) `parse_nested_query` was taking unnecessary steps when the string was
    empty. We can just return a `{}` instead if `qs` is empty.
    
    AllocationTracer object allocation before these changes:
    ```
    [["/rack/lib/rack/utils.rb", 500, :T_STRING], [56981, 4303, 78980, 0, 13, 2032240]]
    [["/rack/lib/rack/utils.rb", 498, :T_STRING], [51000, 0, 45775, 0, 2, 1904680]]
    [["/rack/lib/rack/utils.rb", 114, :T_STRING], [39123, 0, 35116, 0, 1, 4711600]]
    [["/rack/lib/rack/utils.rb", 661, :T_STRING], [32993, 0, 29621, 0, 1, 1232289]]
    [["/rack/lib/rack/body_proxy.rb", 34, :T_ARRAY], [30000, 0, 26930, 0, 1, 1120400]]
    ```
    AllocationTracer object allocation after these changes:
    ```
    [["/rack/lib/rack/utils.rb", 499, :T_STRING], [46665, 969, 54210, 0, 13, 1702720]]
    [["/rack/lib/rack/utils.rb", 662, :T_STRING], [31375, 0, 30647, 0, 2, 1175369]]
    [["/rack/lib/rack/body_proxy.rb", 34, :T_ARRAY], [28550, 0, 27880, 0, 2, 1068800]]
    [["/rails/activesupport/lib/active_support/subscriber.rb", 99, :T_STRING], [28534, 0, 27869, 0, 2, 1068560]]
    [["/rails/activesupport/lib/active_support/notifications/fanout.rb", 55, :T_DATA], [28528, 0, 27864, 0, 2, 3098592]]
    ```
Commits on Feb 4, 2015
  1. @yeonhoyoon

    fix typo

    yeonhoyoon authored
Commits on Feb 2, 2015
  1. @spastorino

    Merge pull request #791 from tagliala/add-woff2-mime-type

    spastorino authored
    Add woff2 mime type
  2. @spastorino

    Remove whitespaces

    spastorino authored
  3. @spastorino

    Merge pull request #788 from arcz/patch-1

    spastorino authored
    Update head.rb Fix indentation and move comment
  4. @spastorino

    Merge pull request #742 from schneems/schneems/freeze-string

    spastorino authored
    Missed optimizations
Commits on Jan 28, 2015
  1. @tagliala

    Add woff2 mime type

    tagliala authored
Commits on Jan 23, 2015
  1. @arcz

    Update head.rb

    arcz authored
    Fix indentation and move comment
Commits on Jan 6, 2015
  1. @p8952

    Update to reflect changes in #514

    p8952 authored
Commits on Dec 23, 2014
  1. @raggi

    Fix lint header regex

    raggi authored
  2. @raggi

    Merge pull request #762 from amarshall/monotonic-runtime

    raggi authored
    Use a monotonic time for Rack::Runtime, if available
  3. @spastorino
  4. @spastorino
Commits on Nov 30, 2014
  1. @amarshall

    Use a monotonic time for Rack::Runtime, if available

    amarshall authored
    Time.now is prone to inaccuracies if the system time changes during the
    request. This could be due to DST, NTP, etc. Using a monotonic clock
    (available in Ruby 2.1+ on certain platforms) avoids this problem.
Commits on Nov 27, 2014
  1. @raggi

    Merge pull request #763 from byroot/multipart-limit-doc

    raggi authored
    Document the multipart_part_limit configuration in the README
  2. @byroot
  3. @raggi
  4. @spastorino

    Merge pull request #399 from EqualMedia/rfc2616-compat

    spastorino authored
    Validate header names according to RFC 2616
  5. @graysonwright @spastorino

    Extract several methods from Rack::File#serving

    graysonwright authored spastorino committed
    Extracted methods:
    
      - mime_type
      - filesize
      - response_body
    
    Closes #570
    
    Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  6. @spastorino

    Fix #639 wrong merge

    spastorino authored
  7. @codekitchen @spastorino

    add rack.multipart options to lint and SPEC

    codekitchen authored spastorino committed
  8. @codekitchen @spastorino

    allow overriding the rack multipart parser tempfile class

    codekitchen authored spastorino committed
    This allows for more flexibility in how to buffer (or stream) multipart
    file uploads, rather than always using Tempfile and buffering to local
    TMPDIR.
Commits on Nov 26, 2014
  1. @spastorino
  2. @spastorino
  3. @byroot @spastorino

    Explicitly fail when hitting the multipart limit

    byroot authored spastorino committed
    Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Commits on Nov 21, 2014
  1. @igas
Commits on Nov 15, 2014
  1. @raggi

    Merge pull request #753 from vais/master

    raggi authored
    Avoid WEBrick handler buffering the entire response in RAM
  2. @vais
Commits on Nov 7, 2014
  1. @tonyta
Commits on Nov 6, 2014
  1. @vais

    Ensure body is closed inside the proc. Follow existing monkey patch s…

    vais authored
    …tyle.
    
    * Serving the rack body is wrapped in begin/ensure/end so that
    body.close is guaranteed to be called per rack SPEC. When body
    iteration happens inside a proc, the proc has to have its own
    begin/ensure/end block to be able to make the same guarantee.
    * Made my monkey patch for WEBrick::HTTPResponse follow same style as
    the other monkey patch already present in the file and added a comment.
Commits on Nov 4, 2014
  1. @vais

    Revert "Ensure body is closed inside the proc just as it would be out…

    vais authored
    …side the proc"
    
    This reverts commit a0b8fe3.
  2. @vais

    Ensure body is closed inside the proc just as it would be outside the…

    vais authored
    … proc
    
    Serving the body is wrapped in begin/ensure/end so that body.close is
    always called if there are any problems. Now that looping over the body
    happens in a proc, the proc has to have its own begin/ensure/end block
    to guarantee the same behavior.
Commits on Nov 3, 2014
  1. @vais
Commits on Oct 10, 2014
  1. @createdbypete

    Fix typo in comment

    createdbypete authored
Commits on Oct 6, 2014
  1. @schneems

    Missed optimizations

    schneems authored
    - freezing constant string to ensure it's not mutated
    - use constant where available
    - optimize `respond_to?` to take less memory. 
    
    Discussed in #737 and #739
    
    `respond_to?` takes two arguments all recent rubies:
    
    - http://ruby-doc.org/core-2.1.3/Object.html#method-i-respond_to-3F
    - http://ruby-doc.org/core-1.9.3/Object.html#method-i-respond_to-3F
    - http://ruby-doc.org/core-1.8.7/Object.html#method-i-respond_to-3F
    
    Also `method_missing` will return a symbol from the first argument:
    
    - http://ruby-doc.org/core-2.1.3/BasicObject.html#method-i-method_missing
    - http://ruby-doc.org/core-1.9.3/BasicObject.html#method-i-method_missing
    - http://ruby-doc.org/core-1.8.7/Kernel.html#method-i-method_missing
Something went wrong with that request. Please try again.