| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since Rails 6.0 will support Ruby 2.4.1 or higher
`# frozen_string_literal: true` magic comment is enough to make string object frozen.
This magic comment is enabled by `Style/FrozenStringLiteralComment` cop.
* Exclude these files not to auto correct false positive `Regexp#freeze`
- 'actionpack/lib/action_dispatch/journey/router/utils.rb'
- 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb'
It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333
Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed.
* Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required
- 'actionpack/test/controller/test_case_test.rb'
- 'activemodel/test/cases/type/string_test.rb'
- 'activesupport/lib/active_support/core_ext/string/strip.rb'
- 'activesupport/test/core_ext/string_ext_test.rb'
- 'railties/test/generators/actions_test.rb'
|
| |
|
|
|
|
| |
ActionView::Template method names
|
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
| |
Add handling of cleaning up backtrace from IRB console in case of errors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Right now BenchmarkCleaner allocates hundreds of strings on every request with an exception. This patch moves those strings to be generated at boot once and re-used.
## Bench Methods
I took a modified form of CodeTriage https://github.com/schneems/codetriage-ko1-test-app/blob/master/perf.rake and ran given rake tasks with and without the patch to BacktraceCleaner.
I made an endpoint results in exception
```
def index
raise “foo"
end
```
The gem `memory_profiler` was used to capture objects allocated for a single request. Then `benchmark/ips` was used to test the speed of the patch.
You will see that we use less objects and the code becomes measurably faster with this patch.
## With patch:
Memory for one request:
```
Total allocated 7441
Total retained 37
```
Requests per second:
```
Calculating -------------------------------------
ips 4 i/100ms
-------------------------------------------------
ips 43.0 (±4.7%) i/s - 216 in 5.037733s
```
## Without patch:
Memory used for one request:
```
Total allocated 11599
Total retained 35
```
Requests per second:
```
Calculating -------------------------------------
ips 3 i/100ms
-------------------------------------------------
ips 39.4 (±7.6%) i/s - 198 in 5.052783s
```
## Analysis
The patch is faster:
```
(43.0 - 39.4 ) / 39.4 * 100
# => 9 # % ~ speed bump
```
It also allocates less objects:
```
11599 - 7441
# => 4158
```
These strings are allocated on __EVERY SINGLE REQUEST__. This patch saves us 4158 objects __PER REQUEST__ with exception.
Faster errors == Faster applications
|
| |
|
|
|
|
| |
BacktraceCleaner#add_gem_filters
|
| |
|
| |
|
|
|
|
| |
rarely showed the full trace. Also, increase performance considerably.
|
|
|
|
|
|
| |
thereby previously making it not match the regex. Support APP_DIRS that have backtrace lines maybe beginning with /. [#4277 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Gem.path now.
|
| |
|
| |
|
|
|
|
|
|
| |
obsolete.
The bundler library is at: http://github.com/wycats/bundler/ and is a rubygem.
|
|
|
|
| |
application's object root)
|
|
|
|
| |
gem paths
|
| |
|
|
|
|
|
|
| |
locations
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
noise from missing template errors.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
state:committed]
Add a prefix argument to filter_backtrace_with_cleaning so it has
the same arity as test/unit's filter_backtrace.
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
|
|
cutting down on backtrace noise (inspired by the Thoughtbot Quiet Backtrace plugin) [DHH]
|