I implement functions for verifying DUT, but its performance is not good.
I use struct type variable and queue, and associative array for comparing.
I want to enhance its performance. So, I wonder about the best way to use struct, class, and array.
My questions are below.
1. If I push_back a struct variable into a queue, will all member variables in the struct variable are copied into a queue?
If it is true, I think often pushing a struct variable into a queue affects performance.
2. If I push_back a class object into a queue, will the only handle be copied into a queue, not all member variables?
If it is true, I think using a class object instead of struct is better from a performance point of view.
3. If I delete an element of the middle in the queue, will all elements after the deleted index are moved(copied) to one left for adjusting an index?
If a queue in the systemVerilog is implemented as a linked list, I think it does not matter. But, If the queue is implemented as a vector or array, I think deleting an element in the middle of the queue can matter for performance.
4. We can use find_xxx methods of array. I think for performance reasons you shouldn't search in the array. Is the find_xxx methods of an array slow?
Are all my questions affected by the simulation tools...?
And I don't want to copy struct variables through arguments of a function. So, I use ref or const ref keyword on the arguments.
Anyway, please let me know if you know the best way to use struct, class, array in terms of performance.
Thank you for your comment.