Skip to content

progress bar and rbspy#15

Open
kohigh wants to merge 6 commits intospajic:masterfrom
kohigh:master
Open

progress bar and rbspy#15
kohigh wants to merge 6 commits intospajic:masterfrom
kohigh:master

Conversation

@kohigh
Copy link

@kohigh kohigh commented Apr 21, 2019

No description provided.

Copy link
Owner

@spajic spajic left a comment

Choose a reason for hiding this comment

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

Nice work! 👍
Some comments in review

)

IO.foreach("#{$support_dir}/#{filename}") do |cols|
row = cols.split(',')
Copy link
Owner

Choose a reason for hiding this comment

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

Можно было бы ещё читать строку посимвольно, чтобы обойтись без split

IO.foreach("#{$support_dir}/#{filename}") do |cols|
row = cols.split(',')

if cols.start_with?('user')
Copy link
Owner

Choose a reason for hiding this comment

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

Вот тут бы мы тогда при встрече с первой запятой посмотрели, что накопили в аккумуляторе и избежали start_with


%self total self wait child calls name
23.11 0.018 0.004 0.000 0.013 1 <Class::IO>#foreach
12.59 0.003 0.002 0.000 0.001 264 <Module::Oj>#dump
Copy link
Owner

Choose a reason for hiding this comment

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

Без dump в принципе можно тоже было бы обойтись, дописывать json потоково просто

require 'benchmark/ips'
require 'yaml'

metrics, = Benchmark.ips do |bench|
Copy link
Owner

Choose a reason for hiding this comment

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

Хм, запятая не лишняя?

Copy link
Author

@kohigh kohigh Apr 27, 2019

Choose a reason for hiding this comment

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

data тут возвращает массив с одним элементом, деструктуризировал хэш сразу :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants