-
Does using an rsx! macro inside another rsx! macro affect performance?
With if:
What is the best approach to take? |
Beta Was this translation helpful? Give feedback.
Answered by
ealmloff
Oct 26, 2024
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RustGrow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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