Re: JavaVM compiler for Python?

fergal@fiachra.ucd.ie
Tue, 18 Apr 95 17:48:24 +0100

Just to add a quick practical comment...

>In article <CVALE.95Apr17161219@netcom20.netcom.com> cvale@netcom20.netcom.com
> (Chris Vale) writes:
>
> Dan> e.g, also. Try something like:
>
> Dan> a = {} for i in [0..1000]: a['indx' + `i`] = 'value' +
> Dan> `i`
>
> Dan> and watch the heap grow!)
>
> Hmm, don't you mean something like
> a = {}
> for i in range(0,1000):
> a['indx'+str(i)] = 'value'+str(i)
> ?
>
> this seems to take less than a second to generate, and less than 15k
> of heap ( 486DX2 66mz running windows/NT 3.5). So what is the problem?
> I think you need to learn a little about the language since your code
> isn't correct anyway. The problem is you seem to be assuming something
> based on your understanding of the underlying architecture rather than
> from practial experience. Try it, you might actually like it.
>

When I timed the above code for 3 iteration counts (1000, 10000, 100000)
as a stdin script on an AlphaServer 4/275 with 512Mb memory I got the
following results

Iters Time CPU % Data Size
------ ------ ------ ---------
1000 0.262 72 74K
10000 2.213 79 2549K
100000 33.9 92 14229K

As can be seen here there does seem to be some sort of heap usage explosion
for the 10000 iteration run (i.e. ~2.5M rather ~740K) but this heap usage
declines again with the 100000 run; however the overall time performance
drops (i.e. ~34 secs rather than ~22).

I don't know perl well enough to write a similar script to compare the two.

However I don't think that it is fare to compare two languages in such a
fashion anyway; it would be better to implement some non-trivial
application in a manner that is efficient for the respective languages,
such that all versions of the application provide the same functionality.
Once this has been done then, and only then, can the languages truly be
compared. Further the comparisons should be for aspects such as code
complexity, maintainability, robustness and reliability as well as pure
speed and memory usage.

Fergal.

--
/ Fergal Mc Carthy <fergal@fiachra.ucd.ie>, | Fergal Mc Carthy,  \
| Advanced Computational Research Group,    | 31 Fosterbrook,    |
| Chemistry Department., U.C.D., Belfield,  | Stillorgan Road,   |
| Dublin 4, Ireland.                        | Dublin 4, Ireland. |
\ Ph: +353-1-706{2284,2418}                 | Ph: +353-1-2601304 /