Commits on Source (2)
-
Yorick Peterse authored
This reduces the overhead of the method instrumentation code primarily by reducing the number of method calls. There are also some other small optimisations such as not casting timing values to Floats (there's no particular need for this), using Symbols for method call metric names, and reducing the number of Hash lookups for instrumented methods. The exact impact depends on the code being executed. For example, for a method that's only called once the difference won't be very noticeable. However, for methods that are called many times the difference can be more significant. For example, the loading time of a large commit (nrclark/dummy_project@81ebdea5) was reduced from around 19 seconds to around 15 seconds using these changes.
-
Rémy Coutable authored
Reduce instrumentation overhead ## What does this MR do? This MR reduces the overhead of instrumented methods. See the commit message of 905f8d76 for more information. ## Are there points in the code the reviewer needs to double check? Not that I can think of. ## Why was this MR needed? The overhead of method call instrumentation was too great. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [x] ~~API support added~~ - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5550
Showing
- CHANGELOG 1 addition, 0 deletionsCHANGELOG
- lib/gitlab/metrics.rb 5 additions, 0 deletionslib/gitlab/metrics.rb
- lib/gitlab/metrics/instrumentation.rb 8 additions, 5 deletionslib/gitlab/metrics/instrumentation.rb
- lib/gitlab/metrics/method_call.rb 2 additions, 2 deletionslib/gitlab/metrics/method_call.rb
- lib/gitlab/metrics/system.rb 4 additions, 4 deletionslib/gitlab/metrics/system.rb
- lib/gitlab/metrics/transaction.rb 6 additions, 21 deletionslib/gitlab/metrics/transaction.rb
- spec/lib/gitlab/metrics/instrumentation_spec.rb 8 additions, 4 deletionsspec/lib/gitlab/metrics/instrumentation_spec.rb
- spec/lib/gitlab/metrics/system_spec.rb 6 additions, 6 deletionsspec/lib/gitlab/metrics/system_spec.rb
- spec/lib/gitlab/metrics/transaction_spec.rb 4 additions, 12 deletionsspec/lib/gitlab/metrics/transaction_spec.rb
- spec/lib/gitlab/metrics_spec.rb 6 additions, 0 deletionsspec/lib/gitlab/metrics_spec.rb