- 30 7月, 2015 13 次提交
-
-
由 schneems 提交于
The instrument method creates new strings, the most common action to instrument is "!render_template` so we can detect when that action is occurring and use a frozen string instead. This change buys us 113,714 bytes of memory and 1,790 fewer objects per request.
-
由 schneems 提交于
No idea why on earth this hash key isn't already optimized by MRI, but it isn't.
💩 This change buys us 74,077 bytes of memory and 1,852 fewer objects per request. -
由 schneems 提交于
When an unknonwn key is passed to the hash in `PRE_CONTENT_STRINGS` it returns nil, when you call "#{nil}" it allocates a new empty string. We can get around this allocation by using a default value `Hash.new { "".freeze }`. We can avoid the `to_sym` call by pre-populating the hash with a symbol key in addition to a string key. We can freeze some strings when using Array#* to reduce allocations. Array#join can take frozen strings. This change buys us 86,600 bytes of memory and 1,857 fewer objects per request.
-
由 schneems 提交于
When generating a url with `url_for` the hash of arguments passed in, is dup-d and merged a TON. I wish I could clean this up better, and might be able to do it in the future. This change removes one dup, since it's literally right after we just dup-d the hash to pass into this constructor. This may be a breaking, change but the tests pass...so :shipit: we can revert if it causes problems This change buys us 205,933 bytes of memory and 887 fewer objects per request.
-
由 schneems 提交于
In handle_positional_args `Array#-=` is used which allocates a new array. Instead we can iterate through and delete elements, modifying the array in place. Also `Array#take` allocates a new array. We can build the same by iterating over the other element. This change buys us 106,470 bytes of memory and 2,663 fewer objects per request.
-
由 schneems 提交于
Most routes have a `route.path.requirements[key]` of `/[-_.a-zA-Z0-9]+\/[-_.a-zA-Z0-9]+/` yet every time this method is called a new regex is generated on the fly with `/\A#{DEFAULT_INPUT}\Z/`. OBJECT ALLOCATIONS BLERG! This change uses a special module that implements `===` so it can be used in a case statement to pull out the default input. When this happens, we use a pre-generated regex. This change buys us 1,643,465 bytes of memory and 7,990 fewer objects per request.
-
由 schneems 提交于
Micro optimization: `reverse.drop_while` is slower than `reverse_each.drop_while`. This doesn't save any object allocations. Second, `keys_to_keep` is typically a very small array. The operation `parameterized_parts.keys - keys_to_keep` actually allocates two arrays. It is quicker (I benchmarked) to iterate over each and check inclusion in array manually. This change buys us 1774 fewer objects per request
-
由 schneems 提交于
The request.script_name is dup-d which allocates an extra string. It is most commonly an empty string "". We can save a ton of string allocations by checking first if the string is empty, if so we can use a frozen empty string instead of duplicating an empty string. This change buys us 35,714 bytes of memory and 893 fewer objects per request.
-
由 schneems 提交于
In `apply_inflections` a string is down cased and some whitespace stripped in the front (which allocate strings). This would normally be fine, however `uncountables` is a fairly small array (10 elements out of the box) and this method gets called a TON. Instead we can keep an array of valid regexes for each uncountable so we don't have to allocate new strings. This change buys us 325,106 bytes of memory and 3,251 fewer objects per request.
-
由 schneems 提交于
When a symbol is passed in, we call `to_s` on it which allocates a string. The two hardcoded symbols that are used internally are `:to_partial_path` and `:to_model`. This change buys us 71,136 bytes of memory and 1,777 fewer objects per request.
-
由 Richard Schneeman 提交于
Fix tests on master
-
由 schneems 提交于
Presumably due to https://github.com/rails/sprockets-rails/pull/265 sprockets was trying to load the "scss" gem but it isn't in the gemfile: ``` ApplicationTests::RakeTests::RakeNotesTest#test_register_a_new_extension: LoadError: cannot load such file -- sass ``` If we use an empty precompile list, it won't try to load sass.
-
由 schneems 提交于
We can prevent the UglifierCompressor from being instantiated prematurely by setting precompile to an empty array in this test.
-
- 29 7月, 2015 5 次提交
-
-
由 Rafael Mendonça França 提交于
Make silence a warning inserted by commit #4b3f8ac
-
由 yui-knk 提交于
-
由 Claudio B. 提交于
[ci skip] `field_error_proc` is used in `ActionView::Helpers::ActiveM…
-
由 yui-knk 提交于
so replace `Active Record` with `Active Model`
-
由 Carlos Antonio da Silva 提交于
pass the correct argument to mock on a test of `validates_length_of`
-
- 28 7月, 2015 15 次提交
-
-
由 yuuji.yaginuma 提交于
-
由 Robin Dupret 提交于
-
由 Yves Senn 提交于
[ci skip] Add a link to action_controller_overview.html
-
由 yui-knk 提交于
-
由 Robin Dupret 提交于
[ci skip] Now Action View is completely separated from Action Pack
-
由 yui-knk 提交于
-
由 Robin Dupret 提交于
-
由 Rafael Mendonça França 提交于
Document, refactor and create test case for ActionDispatch::Response
-
由 Rafael Mendonça França 提交于
Fix misleading errors for has_one through relations
-
由 Rafael Mendonça França 提交于
Change wrong usage in documentation about autoload_paths [ci skip]
-
由 Rafael Mendonça França 提交于
Fix params_wrapper doc [ci skip]
-
由 Kasper Timm Hansen 提交于
Add wildcard template dependencies.
-
由 Arthur Nogueira Neves 提交于
[ci skip] it should be protect_from_forgery
-
由 Rafael Mendonça França 提交于
Allow generating plugins for API applications
-
由 Aditya Kapoor 提交于
-
- 27 7月, 2015 3 次提交
-
-
由 Godfrey Chan 提交于
Ryan Bigg has changed jobs
-
由 Ryan Bigg 提交于
-
由 Kasper Timm Hansen 提交于
-
- 26 7月, 2015 4 次提交
-
-
由 Kasper Timm Hansen 提交于
Remove @connection instance variable only when defined
-
由 Mehmet Emin İNAÇ 提交于
This feature also works with `PUT`, `PATCH` and `DELETE` requests. Also developers can add `:url_encoded_form` and `:multipart_form` into the `:format` for wrapping url encoded or multipart form data.
-
由 Yasuo Honda 提交于
-
由 Sean Griffin 提交于
This is an alternate implementation of #20966. [Sean Griffin & presskey]
-