Commit Graph

13 Commits

Author SHA1 Message Date
Jean Boussier
c91c266872 Enable Style/ExplicitBlockArgument cop
This reduce the stack size which is beneficial for
exceptions performance.

See: https://gist.github.com/byroot/cb3bcadcc3701c2518d002fb8d3a4e7a

However the cop is unsafe because it might change the block arity,
so it can run into some false positives.
2021-09-05 17:06:19 +02:00
bogdanvlviv
b8231433d6
Remove unused code
- Remove `fragment_cache_key` helper declaration.
  It was removed in e70d3df7c9b05c129b0fdcca57f66eca316c5cfc

- Remove `by_private_lifo`.
  It is unused since a7becf147afc85c354e5cfa519911a948d25fc4d
2019-01-30 14:29:17 +00:00
Rafael Mendonça França
e70d3df7c9
Remove deprecated fragment_cache_key helper in favor of combined_fragment_cache_key 2019-01-17 16:08:31 -05:00
schneems
e92adb3da6 Fewer allocations in caching/fragments.rb
Instead of using a splat on the head and tail we can mutate the array by flattening 1 level. We get further savings by not allocating another via `compact` but instead by using `compact!`
2018-08-29 09:49:24 -05:00
yuuji.yaginuma
f9dbc69c64 Show the ENV value correctly in the doc of combined_fragment_cache_key [ci skip]
It seems to need an escape for the showing `ENV`.
https://api.rubyonrails.org/classes/AbstractController/Caching/Fragments.html#method-i-combined_fragment_cache_key
2018-08-22 12:33:03 +09:00
Kir Shatrov
dfcc766163 Use frozen string literal in actionpack/ 2017-07-29 14:02:40 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
David Heinemeier Hansson
75fa8dd309 Use recyclable cache keys (#29092) 2017-05-18 18:12:32 +02:00
Stan Lo
c61488b4ad Unfreeze interpolated string because it's useless. 2017-02-19 23:32:36 +08:00
Stan Lo
dde7134e07 Freeze fragment cache related instrument name.
ActionMailer::Base#instrument_name and
ActionController::Base#instrument_name will be frequently called once
caching is enabled. So it's better to freeze them instead of create new
string on every call.

Also, the instrument name in #instrument_fragment_cache will usually
be "write_fragment.action_controller" or
"read_fragment.action_controller". So freezing them might also gain some
performance improvement. We have done something like this in other places:
https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
2017-02-07 00:41:02 +08:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Rafael Mendonça França
40fa818580 Move Caching module to Abstract Controller
Abstract Controller is the common component between Action Mailer and
Action Controller so if we need to share the caching component it need
to be there.
2016-02-23 21:11:15 -03:00