Asked by rwniceing
at 2024-08-31 05:20:38
Point:500 Replies:9 POST_ID:829210USER_ID:12079
Topic:
Shell Scripting;Linux;C++ Programming Language
Linux script is more or less like interpreted scrip as javascript but working for different platform such as one is for browsers and other is for linux system script, Right ? Is linux-script based on Assembly , C or C++ language ?
I tried one benchmark code speed testing for "fop loop" with linux "time" command ,
The execution time of the C++ program is around 0.01 seconds(11 ms) but for the linux script,
the time is 34 seconds that is totally greater than C++.
Do you have idea to explain the different result ? Or the time difference is depended on
some linux system differnt setting on using memory for script and binary program ?
And attached just simple example code for "for loop" program with iteration of 2e6
Please advise
Rwniceing
Bash shell for loop with 2e6;
I tried one benchmark code speed testing for "fop loop" with linux "time" command ,
The execution time of the C++ program is around 0.01 seconds(11 ms) but for the linux script,
the time is 34 seconds that is totally greater than C++.
Do you have idea to explain the different result ? Or the time difference is depended on
some linux system differnt setting on using memory for script and binary program ?
And attached just simple example code for "for loop" program with iteration of 2e6
Please advise
Rwniceing
Bash shell for loop with 2e6;
C++ for loop with 2e6