[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1638
  • Last Modified:

Conversion form Binary to Ascii Text

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
tatikor_143
Asked:
tatikor_143
1 Solution
 
Jaime OlivaresCommented:
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
 
grg99Commented:
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now