Long ago when taking a racing course, there was a saying;
"A fast lap around the track is a slow lap in the cockpit"

The same holds true for programming. A quickly written program in a high
level language, saves time from a programmers prospective. But likely
makes any execution take longer and require more resources. I equate
that to a quick lap in the cockpit, slow lap around the track. Quick to
develop, slower to run, and much more people running it than developing
it.

Many avoid languages like C, C++, etc that fall more into the low level
category. These days people prefer high level languages like Python,
Ruby, PHP, etc. In past years, Perl and others. Java is a awkward one,
it can fall both into high level and low level and is sorta an in
between.

Now I have long felt wrt to Gentoo there have been excessive waste of
resources when doing various operations, and I am not talking about
compiling. Just running any one of the many Gentoo tools written in
Python. Instead of rambling on with opinions, here are some facts for
comparison.

Comparing the following command, one written in Python (existing), the
other I wrote in C, both run 5 consecutive times. The C route is using
argp[1], and that also sorts the help output. Might be a little more
work being done to create the help in C vs Python. Both are creating the
help dynamically from an array.

java-config --help

        Python          C
real    0m0.645s        0m0.002s
user    0m0.080s        0m0.000s
sys     0m0.040s        0m0.000s

real    0m0.119s        0m0.002s
user    0m0.083s        0m0.000s
sys     0m0.020s        0m0.000s

real    0m0.118s        0m0.002s
user    0m0.080s        0m0.000s
sys     0m0.023s        0m0.000s

real    0m0.117s        0m0.002s
user    0m0.063s        0m0.000s
sys     0m0.040s        0m0.003s

real    0m0.118s        0m0.002s
user    0m0.080s        0m0.000s
sys     0m0.023s        0m0.000s

I think the difference in performance is pretty clear. This is just with
invoking the help option of a command. When it comes to actually doing
the work in C vs Python. I expect the difference between Python and C to
grow substantially. I just ran this test to make sure the time was not
spent in vain. Given it will take much more time to re-code Gentoo's
java-config in C vs Python.

That time will be made up anytime anyone using java-config for anything
on any Gentoo system. Which java-config is used a fair amount not only
when emerging packages, but also when launching Java apps ;)

High level programming is not very GREEN. It saves developers time, but
at what cost to others?

     1. http://www.gnu.org/s/libc/manual/html_node/Argp.html

-- 
William L. Thomson Jr.
Obsidian-Studios, Inc.
http://www.obsidian-studios.com

This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and is
protected by law. If you are not the intended recipient, you should
delete this message.

Any disclosure, copying, or distribution of this message, or the taking
of any action based on it, is strictly prohibited.


---------------------------------------------------------------------
Archive      http://marc.info/?l=jaxlug-list&r=1&w=2
RSS Feed     http://www.mail-archive.com/[email protected]/maillist.xml
Unsubscribe  [email protected]

Reply via email to