Solved

Improve the speed of executing an executable file

Posted on 2000-03-08
8
252 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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
 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

816 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

13 Experts available now in Live!

Get 1:1 Help Now