|
From: <bc...@wo...> - 2001-08-08 20:21:16
|
[john coppola on ghosting and skeletons]
Do you have any code available that I can play with? Based only on your
description, I find it very difficult to understand the philosophy and
goals behind your suggestions.
Assuming that Samuele understod you correctly in the jmerge example, it
seems like the java skeleton should override (or at least hide) the
similar python method. Sort of the same goes for attributes where the
set_/get_ methods in the skeleton is used to intercept attribute access.
Right so far?
I guess that you get a speed increase because the the test for skeleton
is located early in the __findattr__ method. The result of such an early
test is all non-skeleton instances will run a little bit slower, rigth?.
If that is the case, you will have a tough job selling it.
> public int get_b () {
> return b;
> }
I note that references to "b" from python will create a new PyInteger to
hold the returned result. So this particular definition of "get_b"
favors a usage where the skeleton methods makes a lot of changes to "b"
and the python world only retrives the "b" value a few times.
How would a method implemented in the skeleton call a method on the
python instance? Your SpamSkeleton example does not seem to have a
reference to the python instance.
>from time import time
>def test():
> start = time()
> total = 0.0
> for i in range(0,1000000):
> total = total + i + i*2.0
> print time()- start
>
>This test on my computer:
> python2.0: 2.77 seconds
> jython2.1a1: 7.40 seconds
> native java: 0.014 seconds
Now, that is the worst test you can possible use and it certainly will
not convince me of anything important. A far better test is the micro
benchmark by Marc-André Lemburg.
http://www.lemburg.com/files/python/index.html
(I haven't run this for a while, but older version could run with
jython)
The result of the benchmark can be confusing because of the way hotspot
works, but it clearly show changes (both good and bad) when making
performance related changes to the core. Adding new tests that exercise
a skeleton class should be possible.
Most importantly, I urge you to show some code. You could for instance
make a patch and put in jython's patch manager.
regards,
finn
|