-
Notifications
You must be signed in to change notification settings - Fork 109
--benchmark, fixes #217 #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
One rubocop issue remaining:
There are many ways to fix this, but I always try to avoid refactors in other people's projects :) Happy to address this if you give me some direction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the wait. Works well, most important comments are for lib/image_optim.rb, everything else is code style and nitpicks.
About tests - better to know if it will break, so at least on the level of that it works.
About TableTennis - I understand the desire to make it beautiful, but the output is so simple, that it feels excessive. From one side it shouldn't add more than few lines of code, from the other there are lots of different gems to print a table in terminal and everyone may have their preferred one.
About changelog entry - definitely and some mention in readme
lib/image_optim.rb
Outdated
dst = src.temp_path | ||
begin | ||
begin | ||
worker.optimize(src, dst, timeout: timer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if applying worker always to the original is more informative then doing it in chain (on result of previous worker) as will be done during normal operation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a --chain
later if people like this. I think those results would be interesting as well, especially now that I've seen the worker_analysis
script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worker_analysis
is there to understand tool interaction, try different options, in the end decide about usefulness, order. When using --benchmark
I think it may be confusing if two tools report reduction by 50%, but when combined - only by 51%
Thanks for the feedback! I added a simple test and applied the feedback. I think this is ready for another look now, no rush |
lib/image_optim.rb
Outdated
dst = src.temp_path | ||
begin | ||
begin | ||
worker.optimize(src, dst, timeout: timer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worker_analysis
is there to understand tool interaction, try different options, in the end decide about usefulness, order. When using --benchmark
I think it may be confusing if two tools report reduction by 50%, but when combined - only by 51%
OK, thanks for the feedback. How about this? No rush! |
@gurgeous For me the biggest question is still about showing worker efficiency in isolation instead of the way they would run in chain when applied on result of previous (see my comment). Can you describe why you want to go with the isolated way? |
Ah, yes. I use image_optim as part of my build. My personal goal is to identify and eliminate the image_optim tools that provide little benefit for my use case. I don't need to squeeze every last drop of optimization out of the system, and speed is very important. With
In fact, I could probably get by with No worries if this feels out of scope for image_optim. I'm very happy with the tool and I appreciate all your hard work! |
It can call out very slow tools, but it doesn't show how will the tools behave in chain (also probably they take same amount of time, but with less effect). Also reminds of a very old issue #10, as tools with faster configuration can be very quick and still optimise images a bit. So to have a good picture it would be better to have a way similar to |
I would love to see a |
I'm not suggesting to add chain benchmark here, just make current variant explicit like |
Ah, I see. That sounds good, see latest commit. |
I meant the type to be required, also op.on("--benchmark TYPE", [:isolated], "Run benchmark in one of modes", "isolated …") do |benchmark|
p benchmark
end Also probably disable |
This is not done yet, but I thought you might want to take a look. Maybe something like this? See sample output below. A few questions:
Thanks!!