Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question
6  
Please do not ask the same question on multiple sites. If you think it is off topic for one, please flag it and ask for it to be migrated to the other site. –  MichaelT Jul 13 '13 at 5:24
    
MichaelT,I m new to these sites. I'll take care of ur suggestion from now on. I don't think its off topic . SO ,SE are great websites most of the times i get my answers here. I created account recently so posted on multiple sites at the same time because it is very urgent for me to know the answer for my problem. I believe there are active expereinced programmers who help many people through these websites. –  coder Jul 15 '13 at 7:16
add comment

1 Answer

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.

share|improve this answer
    
Doc Brown , i've already done what you suggested.I can see the time taken by these datastructures to answer ny queries. I am executing the query on a single dataset sufficiently large number of times to measuer the time. My concern is measuring disk IOs , memeory usage , cpu cycles etc.. how is that done? –  coder Jul 15 '13 at 7:11
    
@coder: from your question I was under the impression you know already how to do this - utilize the tools you mentioned. I suggest you edit your questions and add some details to make clear what kind of problem you have. For example, why do you think dstat and iostat don't give you "an accurate and professional" solution? –  Doc Brown Jul 15 '13 at 12:07
    
Doc Brown thnx for your revert.I want to know how to measure disk IO,read/write,cpu cycles used etc in answering querying by these datastructs.In dstat command how can i know if the disk read/write shown at that instant is for my code, it doesnt show the program name or pid etc. –  coder Jul 15 '13 at 13:55
    
@coder: I still suggest you edit your question accordingly (didn't I write this?). This will bring it on top of the list of active questions again, and you will probably get some more attention by people now understanding what you really want. –  Doc Brown Jul 15 '13 at 16:32
    
done editing..... –  coder Jul 15 '13 at 21:06
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.