From 78d09e3ef3df117499c172604bfa2ff51d21351d Mon Sep 17 00:00:00 2001 From: Marcel Amirault Date: Tue, 10 Sep 2019 10:15:43 +0000 Subject: Start linting for unneeded dollar signs Do not use dollar signs in shell codeblocks when no output is shown --- doc/development/performance.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'doc/development/performance.md') diff --git a/doc/development/performance.md b/doc/development/performance.md index 14b3f8204d2..6e6c80b7a7c 100644 --- a/doc/development/performance.md +++ b/doc/development/performance.md @@ -123,7 +123,7 @@ Keeping that in mind, to create a profile, identify (or create) a spec that exercises the troublesome code path, then run it using the `bin/rspec-stackprof` helper, e.g.: -``` +```sh $ LIMIT=10 bin/rspec-stackprof spec/policies/project_policy_spec.rb 8/8 |====== 100 ======>| Time: 00:00:18 @@ -157,22 +157,22 @@ it calls, were being executed. To create a graphical view of the call stack: -```shell -$ stackprof tmp/project_policy_spec.rb.dump --graphviz > project_policy_spec.dot -$ dot -Tsvg project_policy_spec.dot > project_policy_spec.svg +```sh +stackprof tmp/project_policy_spec.rb.dump --graphviz > project_policy_spec.dot +dot -Tsvg project_policy_spec.dot > project_policy_spec.svg ``` To load the profile in [kcachegrind](https://kcachegrind.github.io/): -``` -$ stackprof tmp/project_policy_spec.dump --callgrind > project_policy_spec.callgrind -$ kcachegrind project_policy_spec.callgrind # Linux -$ qcachegrind project_policy_spec.callgrind # Mac +```sh +stackprof tmp/project_policy_spec.dump --callgrind > project_policy_spec.callgrind +kcachegrind project_policy_spec.callgrind # Linux +qcachegrind project_policy_spec.callgrind # Mac ``` It may be useful to zoom in on a specific method, e.g.: -``` +```sh $ stackprof tmp/project_policy_spec.rb.dump --method warm_asset_cache TestEnv#warm_asset_cache (/Users/lupine/dev/gitlab.com/gitlab-org/gitlab-development-kit/gitlab/spec/support/test_env.rb:164) samples: 0 self (0.0%) / 6288 total (36.9%) @@ -225,9 +225,9 @@ may have changed over time. To activate profiling in your local environment, run the following: -``` -$ export RSPEC_PROFILING=yes -$ rake rspec_profiling:install +```sh +export RSPEC_PROFILING=yes +rake rspec_profiling:install ``` This creates an SQLite3 database in `tmp/rspec_profiling`, into which statistics @@ -237,7 +237,7 @@ variable set. Ad-hoc investigation of the collected results can be performed in an interactive shell: -``` +```sh $ rake rspec_profiling:console irb(main):001:0> results.count => 231 -- cgit v1.2.1