Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require: rubocop-performance
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

16 changes: 16 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

ruby '2.7.1'

gem 'pry'
gem 'rspec'
gem 'rspec-benchmark'
gem 'rubocop'
gem 'rubocop-performance'
gem 'ruby-prof'
gem 'stackprof'
gem 'minitest'
75 changes: 75 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
benchmark-malloc (0.2.0)
benchmark-perf (0.6.0)
benchmark-trend (0.4.0)
coderay (1.1.3)
diff-lcs (1.4.4)
method_source (1.0.0)
minitest (5.14.4)
parallel (1.20.1)
parser (3.0.1.1)
ast (~> 2.4.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
rainbow (3.0.0)
regexp_parser (2.1.1)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-benchmark (0.6.0)
benchmark-malloc (~> 0.2)
benchmark-perf (~> 0.6)
benchmark-trend (~> 0.4)
rspec (>= 3.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
rubocop (1.13.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.5.0)
parser (>= 3.0.1.1)
rubocop-performance (1.11.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-prof (1.4.3)
ruby-progressbar (1.11.0)
stackprof (0.2.17)
unicode-display_width (2.0.0)

PLATFORMS
ruby

DEPENDENCIES
minitest
pry
rspec
rspec-benchmark
rubocop
rubocop-performance
ruby-prof
stackprof

RUBY VERSION
ruby 2.7.1p83

BUNDLED WITH
2.1.4
3 changes: 1 addition & 2 deletions case-study-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
## Feedback-Loop
Для того, чтобы иметь возможность быстро проверять гипотезы я выстроил эффективный `feedback-loop`, который позволил мне получать обратную связь по эффективности сделанных изменений за *время, которое у вас получилось*

Вот как я построил `feedback_loop`: *как вы построили feedback_loop*
Вот как я построил `feedback_loop`: *как вы построили feedback_loop* решил разделить запуск тестов и запуск проверки производительности в разных файлах, а разграничивать передачу файла через передачу аргумента

## Вникаем в детали системы, чтобы найти главные точки роста
Для того, чтобы найти "точки роста" для оптимизации я воспользовался *инструментами, которыми вы воспользовались*
Expand Down Expand Up @@ -53,4 +53,3 @@

## Защита от регрессии производительности
Для защиты от потери достигнутого прогресса при дальнейших изменениях программы *о performance-тестах, которые вы написали*

292 changes: 292 additions & 0 deletions case-study.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions result.json

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions ruby-prof.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'ruby-prof'
require_relative './task-1'

RubyProf.measure_mode = RubyProf::WALL_TIME

result = RubyProf.profile do
work(file: 'data100000.txt', disable_gc: true)
# work(file: "data_large.txt", disable_gc: false)
end

printer = RubyProf::MultiPrinter.new(result, %i[flat graph graph_html tree call_info stack dot])
# printer.print(File.open("ruby_prof_reports/calltree.html", "w+"))

# CallTreePrinter
# printer.print(path: "ruby_prof_reports", profile: "callgrid")
# RubyProf::MultiPrinter
printer.print(path: 'ruby_prof_reports_multi', profile: 'profile')
Loading