-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add a very basic SVG render tool to vello_toy
#840
base: main
Are you sure you want to change the base?
Conversation
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.
LGTM. A couple of details
#[arg(long)] | ||
pub path: String, | ||
/// The target runtime for calculating how many iterations to run, in milliseconds. | ||
#[arg(long, default_value_t = 2000)] |
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'd prefer for this to default to running a single iteration, i.e.:
#[arg(long, default_value_t = 2000)] | |
/// For simple benchmarking, our current recommended value is 2000 (i.e. 2 seconds). | |
#[arg(long, default_value_t = 0)] |
I do agree that the benchmarking is a useful tool, but I don't think it should be the default.
(I can also see arguments for a benchmark
flag, but that's probably too much complication for now)
let avg_runtime = (runtime.as_millis() as f32) / (num_iters as f32); | ||
|
||
eprintln!( | ||
"ran {} iterations, with an average runtime of {}ms to render {}.", |
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.
Given that we run until the current item finishes, I think the priority should be on the average_runtime
, rather than on the number of iterations.
|
||
eprintln!( | ||
"ran {} iterations, with an average runtime of {}ms to render {}.", | ||
num_iters, avg_runtime, file_name |
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.
Would it also make sense to display the standard deviation? I think that's harder to calculate; we'd need to save all the results?
So probably not worth doing, then
I'll let this PR rest for a while until we have merged the other bigger, pending PRs. |
Is that referring to #831 (adding Vello Hybrid, which has now landed)? |
Yep! |
Example:
cargo run --bin svg --release -- --path "C:\Users\lstam\Documents\Programming\vello\examples\assets\Ghostscript_Tiger.svg" --scale 5
Obviously far from feature complete, but my goal for now is to only implement very basic stuff.