Solved

Conversion form Binary to Ascii Text

Posted on 2007-11-29
4
1,625 Views
Last Modified: 2010-10-05
Hi,

I developed a tool which converts the binary formatted log reports to ascii format on windows.I have all the code in the Expert Exchnage portal..Here is the link to it..

http://www.experts-exchange.com/Programming/Languages/C/Q_22110125.html

Here every thing works fine and gives the desired output but the issue here is it takes lot of time to convert one log report..nearly 4-5 minutes of time and it is also making the system slow once the conversion is done.

Actually what happens is it loads the symbol table on to the main memory and it looks for the corresponding symbol sname with the symbol address with the symbol address form the log report.So, this has to be done for each and every log report and therefore it takes so much of time to convert .

Any idea on how to reduce the conversion time and increase the system performance.

A wuick response is highly appreciated.

Thanks in advance.
0
Comment
Question by:tatikor_143
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20380078
well, you can't have a quick response with this huge code, maybe you can focus on the file-reading code and the processing portion.
A tipical bottleneck in processing a file, is when you read it record-by-record. You can accelerate meaningfully by using a bigger buffer, that is, reading 100 by 100 records, or maybe more, you can reduce time to 1/5 or 1/10 according to my experience.
0
 
LVL 22

Accepted Solution

by:
grg99 earned 500 total points
ID: 20381536
First instrument your program so it counts the number of bytes of log file read in, the elapsed time, and prints out the megabytes/second processed.    You can't improve what you don't measure.

Then run the program as is, then with the symbol lookup feature commented out.  That will reveal if the problem is in there or somewhere else.

If that *is* a major bottleneck, switch to some faster symbol lookup method.   I didnt look too closely at your code, but at the very least you should keep the symbols in memory.  Better yet, sorted, so you can do a binary search instead of a linear search.

The overall afterward system slowdown is probably due to the disk cache getting flushed by all the I/O activity.   There isn't much you can do about this short of getting more RAM..   You could have your program do cacheless disk i/o, but that would slow down your program even more.


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question