Skip to content

Compare the performance of if and match inside the rsx macro! #3101

Answered by ealmloff
RustGrow asked this question in Q&A
Discussion options

You must be logged in to vote

If statements and match statements inside rsx just turns into rust's if statements and match statements. The performance difference will be the same. I would expect the first version (match) to be faster because you are getting the data from the hashmap at the same time you are checking if it exists, but the difference will likely be negligible either way

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RustGrow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants