Heyas
I've been working on my project TUI (Text User Interface) for quite some time now, its a hobby project, so nothing i sit in front of 8hrs/day.
Since the only 'real' programming language i kn[eo]w is Visual Basic, based upon early steps with MS-Batch files. When i 'joined' linux 3 years ago, i was a bit overhelmed upon my first approaches (those were back in 199X) with QT/dont-recall with GUI.
Thus, i followed another dream of mine, and started to write TUI - using BASH.
Anyhow, i've been suggested to re-write it as python, as it would be so much faster.
Well, i finaly feel 'confident' enough to actualy start learning a new language, with the first 'speed' comparisons between a simple example script.
Reason for my question is, BASH seems faster than python using the example tutorial script.
And before i completly (re)-write my already existing and working project, i want to be sure that there WILL be a noticable performance boost...
#!/usr/bin/bash
echo "The script is called: $0"
echo "Your first variable is: $1"
echo "Your second variable is: $2"
echo "Your third variable is: $3"
#!/usr/bin/python
from sys import argv
script, first, second, third, four = argv
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
While i call both scripts like:
time ./test.[py|sh] 1 2 3 4
I get these result ranges:
py: 0.017 - 0.038
sh: 0.005 - 0.008
Which leads me to the conclusion that bash is faster in displaying.
So i'm quite irritated by the 'promise' my friend gave me, and what i see here.
Not only that bash seems faster (with the above scripts at least, i'm aware that they are very small), also the compare between the fastest and slowest is more than the double for python, while bash is less than double.
Allthough i usualy could blindly trust him on technical stuff, i'm not doing this (anyone for that matter), if it means i have to start from 0 and drop my 'baby'...
Specialy since i just rewrote the core components with the aim for speed/performance/optimizations, i could decrease the time needed to display the 'basic config script' from 1.6 sec (sometimes 2.2) to less than 0.3 sec (on average).$
The screenshot is ment as example how TUI looks like, what i intend to display.
Its that white-blue stuff and those # |
and | #
borders, note that the variables are read using another script/application that is part of TUI.
So i would like to ask you guys, and your collected experience, if python IS faster than bash in displying info to terminal?
Thank you in advance
Regards
PS: Could not attach screenshot while post is/was not posted (please notify admin)