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

Benchmark #16

Open
jonthegeek opened this issue Aug 5, 2023 · 3 comments
Open

Benchmark #16

jonthegeek opened this issue Aug 5, 2023 · 3 comments

Comments

@jonthegeek
Copy link
Owner

I'm not sure whether this should be a vignette or just something in tests, but somewhere I should compare code with my checks to code without the checks, and to checks using checkmate and maybe things like vec_cast.

@jonthegeek
Copy link
Owner Author

to_int() adds about 20 microseconds for a length-1-million integer. SAME for length-10-million, which is good.
with_stabilize has to look at the values, so it added about 3 milliseconds for 10^6, almost 50 ms for 10^7.

Adding microseconds feels tolerable.

When coercion is necessary, it adds microseconds even for to_int(), but to be fair it's actually DOING something. It's almost identical to as.integer.

For these simple cases, ykwim is faster than checkmate!

@jonthegeek
Copy link
Owner Author

I will have to add this to the readme or an article or something eventually....

@jonthegeek
Copy link
Owner Author

Do this as an article.

Compare to as(), stopifnot(), and the various packages.

{stbl} will be slower than some of them, but it shouldn't be slower than what it takes to turn that thing into {stbl}, basically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant