Skip to content

progress bar and rbspy#15

Open
kohigh wants to merge 6 commits into
spajic:masterfrom
kohigh:master
Open

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

Conversation

@kohigh

@kohigh kohigh commented Apr 21, 2019

Copy link
Copy Markdown

No description provided.

@spajic spajic left a comment

Copy link
Copy Markdown
Owner

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

Comment thread lib/parser.rb
)

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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

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

if cols.start_with?('user')

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

@kohigh kohigh Apr 27, 2019

Copy link
Copy Markdown
Author

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