Solved

Improve the speed of executing an executable file

Posted on 2000-03-08
8
249 Views
Last Modified: 2010-04-21
I am using HP Trusted OS v10.26
I have an executable file named "test" of size of 10MB.
I put a system("date") command in my first line of my code
eg main()
     {
               system("date");
               ............
     }
I create a script file run.exe with the following:
date
system("test");

When I run this script, I found out that the date in the first line of the script and the date in the first line of the executable file is 5-8seconds.

My boss wants to run the executable file and complete within less than 5 seconds but this alone has already taken 5-8 sec.
Can anyone provide me with a solution on how to reduce the speed of the
execution? Thanks
0
Comment
Question by:wmlim060298
8 Comments
 
LVL 3

Expert Comment

by:freesource
ID: 2599632
What language is the executable written in?

You may want to break it up into smaller programs, or make it more modular.  It's hard to give good advice without know what the test program does or in what manner it was written.
0
 

Author Comment

by:wmlim060298
ID: 2599818
The program is written in C++. Anyway, does it matter what language is it written in?
This is because I want to improve the speed of the program from the time it is executed to the time the execution starts, i.e. the main command in the main() is not called yet.
Look at my script.

I think maybe it is due to the loading of the program into the memory before execution that takes such a long time, is there any where I can improve this time?

I cannot break the program up, this is the optimised size. I even strip the executable file.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 150 total points
ID: 2600319
1. insert more RAM
2. use a faster disk
3. compile/link as shared executable
4. replace system() by the appropriate libc-call, for example: time()
0
 
LVL 2

Expert Comment

by:bedot
ID: 2600387
beware at the name test, which is a reserved word of the shell;

HP needs more and more processes, sometimes for only a job;

try to use system calls to obtain the time rather than the system routine that need to launch another shell

try to identify where you loss so much time: in the program itself, or in the calling of the system function: to do that, make a short cut in your program;
in this maneer, you can found the part of your program where you loss so much time.

use the top command and the sar command to survey the time consumption in your system

good luck !
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 2600551
> try to identify where you loss so much time: ...
it's obvious: 10MB need to be loaded first
beside my suggestions 1. .. 3. you also may tune the kernel how it distributes the timeslices for each process
0
 

Author Comment

by:wmlim060298
ID: 2600806
I cannot  insert more RAM because no more money to buy more RAMs.
I cannot buy faster disk also because of same reason
I have already compile/link my exeuctable file using shared library
To replace system() by the appropriate libc-call, for example: time() is not a solution for me to solve my problem.

However, I think tuning the kernel maybe able to solve my problem. Please advise me on this tuning. How can I do it?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2607548
which OS, which shell?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2607552
oops, have just seen HP 10.26 in the question. Sorry no expert-experiance with this for kernel tuning.
But you may try to stop as much processes as possible, and then try again to start your applikation.
Start your applikation with the time command, several times close to each other, and post the results.

> .. time() is not a solution for me to solve my problem.
why?
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

760 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

20 Experts available now in Live!

Get 1:1 Help Now