[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Improve the speed of executing an executable file

Posted on 2000-03-08
8
Medium Priority
?
258 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
[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
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 450 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
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…
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…
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.
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