[Info-vax] Python for x86?
Arne Vajhøj
arne at vajhoej.dk
Mon May 1 19:36:41 EDT 2023
On 4/13/2023 8:26 AM, Simon Clubley wrote:
> On 2023-04-13, Arne Vajhøj <arne at vajhoej.dk> wrote:
>> On 4/13/2023 6:44 AM, Neil Rieck wrote:
>>> And although python is used to do a lot of admin scripting on Linux
>>> platforms (tools like "yum" and "firewall-cmd" are written in
>>> python), python does a really good job supporting server-side
>>> scripting under apache cgi-bin. I don't know how this is possible,
>>> but python programs are faster than compiled DEC-BASIC programs
>>> started via apache.
>>
>> That is unexpected. If both are run via CGI mechanism then
>> script activation should be the same. And compiled code should be
>> faster than interpreted code. And if libraries used are also the
>> same then it is a mystery.
>>
>
> Maybe. Maybe not. Based purely on some comments from people here who
> know/use DEC Basic, it's quite possible that DEC Basic has a RTL which
> imposes some serious runtime overheads.
>
> Perhaps for one of your many articles (:-)), you may be interested in
> coding the same set of problems in the various DEC languages and seeing
> what the performance differences are.
I already have such code. Just needed to add a few VMS specific.
I don't think it can carry an independent article.
But here are some numbers:
Integer operations
Alpha sim Itanium
(no JIT) (older)
C, Pascal, Fortran 24-29 246
Basic 5 38
Ada (gnat make) 8 -
Ada (gnat make -gnatp "-O3") 44 -
Java 5 11 -
Java 8 - 286
Python 2 0.05 -
Python 3 - 0.6
We see that Basic is significant slower than C/Pascal/Fortran,
but still significant faster than Python.
Not a problem for Python. An extreme CPU intensive calculation
is not what one use an interpreted language for (but one may
very well use an interpreted language to control/orchestrate
such a calculation.
As a side note: on other platforms the PyPy (which uses JIT)
are about 60 times faster than regular CPython.
String operations (*)
Alpha sim Itanium
(no JIT) (older)
C 0.076 1.94
Pascal 0.005 0.32
Fortran 0.002 0.07
Basic 0.039 1.31
Ada (gnat make) 0.005 -
Ada (gnat make -gnatp "-O3") 0.005 -
Java 5 0.033 -
Java 8 - 1.76
Python 2 0.005 -
Python 3 - 0.65
*) string operations are done "natural", which means that they are done
different in different languages.
Here Basic actually do quite well.
Python also, which is probably because it calls some
functions written in C to do a lot of the work.
The high numbers for C probably just reflect that a fixed
size char array being appended to is more efficient than
working with real dynamic strings.
Arne
More information about the Info-vax
mailing list