Skip to content
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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Add a very basic SVG render tool to vello_toy #840

wants to merge 3 commits into from

Conversation

LaurenzV
Copy link
Contributor

@LaurenzV LaurenzV commented Mar 8, 2025

Example:
cargo run --bin svg --release -- --path "C:\Users\lstam\Documents\Programming\vello\examples\assets\Ghostscript_Tiger.svg" --scale 5

svg

Obviously far from feature complete, but my goal for now is to only implement very basic stuff.

Copy link
Member

@DJMcNab DJMcNab left a 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)]
Copy link
Member

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.:

Suggested change
#[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 {}.",
Copy link
Member

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
Copy link
Member

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

@LaurenzV
Copy link
Contributor Author

I'll let this PR rest for a while until we have merged the other bigger, pending PRs.

@LaurenzV LaurenzV marked this pull request as draft March 10, 2025 12:24
@DJMcNab
Copy link
Member

DJMcNab commented Mar 14, 2025

Is that referring to #831 (adding Vello Hybrid, which has now landed)?

@LaurenzV
Copy link
Contributor Author

Yep!

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