I have two tree data-structures that I made in C++ , and they give a response for range queries/point queries in that program. I am using Ubuntu. I need help in understanding the way to compare the performance of these two data structures (for answering the query in that program) in external memory. How can I do this?
I searched a lot on the Internet, and I didn’t find any clear idea on how this is done. I know I can measure disk I/O, memory consumption, CPU usage, etc. using Ubuntu’s dstat, and iostat commands. I need some accurate and professional way to do this.
2
Write a test program executing the same set of queries against the same set of data using either the first or the second data structures. Measure the running time for both scenarios. Compare.
Of course, you should make sure that your test queries are representative for the kind of queries you may have to execute in production. And you should make the number of queries big enough to be sure you measure actually the running time of the queries (and not the start-up time of your test program, for example).
EDIT: to your comment: for getting information about disk IO or memory consumption, I think you may look into the Linux “/proc” filesystem and check if it contains what you are after. For example, /proc/<your process id here>/smaps
gives you the memory usage.
7