Linux Blog

Bash, PHP or Perl?

Filed under: Shell Script Sundays — TheLinuxBlog.com at 12:23 pm on Sunday, January 6, 2008

One thing that is for certain is that some people like performance. Running an operating system like Linux gives you choices right out of the box for scripting. This blog post will show the differences in times between Bash, PHP and Perl.

Basically what I have done is created three scripts, one in each language. Then I run them with the time tool to test out the execution time.

Here are the results of echoing 1-100000 out to /dev/null for each script:

BASH:

real 0m1.966s
user 0m1.664s
sys 0m0.072s

PHP:

real 0m0.309s
user 0m0.220s
sys 0m0.048s

Perl:

real 0m0.126s
user 0m0.096s
sys 0m0.000s

You can clearly see out of this the order of performance by this test is Perl, PHP and then BASH. Now, what is interesting is when I run the script to stdout these are the results:

BASH:

real 0m8.689s
user 0m2.408s
sys 0m0.416s

PHP:

real 0m4.381s
user 0m0.544s
sys 0m0.372s

Perl:

real 0m3.938s
user 0m0.244s
sys 0m0.324s

Bash takes about twice as long as Perl / PHP to complete the exact same task. The winner of this test is Perl but I’ll be doing more tests over time when I become more familiar with Perl

Linux Experts

Filed under: General Linux — TheLinuxBlog.com at 3:46 pm on Wednesday, January 2, 2008

After researching Bomgar I thought this could be a good home business. So I started researching to see what companies out there offer Linux services. What did I find? Well, not a whole lot of anything really. I mostly found a whole bunch of junk on the web and a lot of pages with “It Works!!!” (apache setup congratulations page) domains. This made me think that the Bomgar solution could work for any one with the Linux skills needed to support customers and the time to invest in marketing such a company. It is something that I am very interested in doing.

Whilst researching this led me to another thought
“What exactly is a Linux Expert anyway?”
I still can’t come up with a way to describe it. There are so many topics that it (in my opinion) is hard to be a true “Linux Expert”. You have to be more than just a jack of all Linux related trades but also a master of communication and project management. Something most “Linux Experts” lack. I tried to come up with a good way to compare it to another field.

I could compare a Linux Expert to a mechanic. I say this because there are many types of mechanics. Some better than others, some are totally non related. Take an aircraft mechanic, this is a whole lot different from an automotive mechanic. I wouldn’t want my car mechanic working on a plane I would be flying on. This would be like having your Linux sales expert configuring your advanced partitions with fdisk. The chances are they might break something along the way. The results may not be as bad as the loss of human lives but you get the point.

In my opinion there are a lot more Linux experts out there than you think. Just like there are a lot of people who are expert mechanics but do not have the title. Every one knows some one who can fix their car because its a popular service. Are Linux experts lacking because there is no demand for Linux support? Or is it because nobody can find the real experts?

You decide & let me know!

« Previous Page