Solved

Conversion form Binary to Ascii Text

Posted on 2007-11-29
4
1,614 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
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

A short article about problems I had with the new location API and permissions in Marshmallow
This is about my first experience with programming Arduino.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now