Skip to content

Instantly share code, notes, and snippets.

View paderinandrey's full-sized avatar

Andrey Paderin paderinandrey

View GitHub Profile
# frozen_string_literal: true
require 'test_prof/recipes/rspec/any_fixture'
require 'test_prof/any_fixture/dsl'
using TestProf::AnyFixture::DSL
require 'test_prof/ext/active_record_refind'
using TestProf::Ext::ActiveRecordRefind
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
# frozen_string_literal: true
require 'rails_helper'
using TestProf::AnyFixture::DSL
describe 'Home' do
let(:scopes) { 'read:statuses' }
let_it_be(:bob) { Fabricate(:account) }
@paderinandrey
paderinandrey / solution.rb
Created December 16, 2024 01:29
TH: ruby-c11y-hw1
# Генерация файлов для примера
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)