[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Conversion form Binary to Ascii Text

Posted on 2007-11-29
4
Medium Priority
?
1,635 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

656 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