This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'debug' | |
| target = ENV.fetch('TARGET', 'spec/requests') | |
| run :event_prof, event: 'factory.create', top_count: 10, paths: target, rank_by: :time | |
| total_run_time = report.raw_report['absolute_run_time'] | |
| total_event_time = report.raw_report['total_time'] | |
| threshold = 0.5 * total_run_time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| require 'rails_helper' | |
| using TestProf::AnyFixture::DSL | |
| describe 'Home' do | |
| let(:scopes) { 'read:statuses' } | |
| let_it_be(:bob) { Fabricate(:account) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Генерация файлов для примера | |
| files = 5.times.map do |i| | |
| filename = "file_#{i}.txt" | |
| File.open(filename, 'w') { |f| f.puts(Array.new(100_000) { "Line from #{filename}" }) } | |
| filename | |
| end | |
| require 'parallel' | |
| def process_files_with_parallel(files) |
OlderNewer