[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Thread safe coding, Java or C
- Subject: [ale] Thread safe coding, Java or C
- From: dustin.h.strickland at gmail.com (Dustin Strickland)
- Date: Sat, 20 Jul 2013 00:45:44 -0400
- In-reply-to: <CAAt=rgBqt-Nw0VBeBNkcPHrw9u9B=VhfqFKE=7CJSJ2oLr3+zA@mail.gmail.com>
- References: <[email protected]> <CAAt=rgDLBef8daDgH4R5nz-5QCKqJ=Ct2e3BqT7iSkbhT3R7jQ@mail.gmail.com> <CADvA-d=+3c56zunDTkjVEKmMfkkBBie++8zp1K3=o7VzoPJqRQ@mail.gmail.com> <CAHWNiXyqXFtZPXF3iJ5we0DFnGb+psny7DY=7E+Zj2kOi6Opdw@mail.gmail.com> <CAAt=rgBqt-Nw0VBeBNkcPHrw9u9B=VhfqFKE=7CJSJ2oLr3+zA@mail.gmail.com>
Sorry; having programmed quite a bit in Python, I forgot that it might not
be common knowledge. Honestly, my statement was a bit of an
over-simplification. It really depends on what you're doing and how well
you know the performance bottlenecks, including which libraries you can use
to speed things along - but that applies with any language, whether
interpreted or compiled. Please remember, I'm not claiming that Python is *as
fast as* C.
From
http://stackoverflow.com/questions/6964392/speed-comparison-with-project-euler-c-vs-python-vs-erlang-vs-haskell
:
C: 100%
> python: 692% (118% with pypy)
> erlang: 436% (135% thanks to RichardC)
> haskell: 1421%
The general consensus is that, for most purposes(considering the hardware
of today), Python isn't too much more resource-hungry than a C program that
does the same thing, and is considerably faster than other interpreted
languages. Personally, I can see several points in the script he generated
those times from(using range() instead of xrange(), etc.) that cause
unnecessary CPU usage, so the 692% figure when compared with C isn't quite
right.
With that in mind, you're probably not going to be writing highly optimized
programs in Python anyway; that's just not what it was designed for.
On Sat, Jul 20, 2013 at 12:13 AM, James Sumners <james.sumners at gmail.com>wrote:
>
>
> On Saturday, July 20, 2013, Dustin Strickland wrote:
>
>> Ew, Java... How about Python? It's almost as effecient as C code, and has
>> a decent built-in library for threads.
>>
>
> You're going to have to support at least the first part of that statement
> with some evidence.
>
>
> --
> James Sumners
> http://james.roomfullofmirrors.com/
>
> "All governments suffer a recurring problem: Power attracts pathological
> personalities. It is not that power corrupts but that it is magnetic to the
> corruptible. Such people have a tendency to become drunk on violence, a
> condition to which they are quickly addicted."
>
> Missionaria Protectiva, Text QIV (decto)
> CH:D 59
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20130720/c2576795/attachment.html>