Re: Re: Re: class proposal

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Lenard Lindstrom wrote:

> But if you are going to have classes then you should make sure they
> are used
> to full advantage. I do not know how Prothon currently handles mro
> calculations. If it is doing it for every attribute lookup that is
> too expensive. Certainly it will be for C3. But classes let you
> calculate the mro once at class creation
> and keep it around as a list. Much faster.

Prototypes in general are dynamic and do everything at run-time which has a
big performance penalty.  MRO calculations are no exception and are being
done on every lookup right now, although multiple prototypes are rare.

The solution is through caching just as JIT is the solution for the
interpreter.  Caching will cache the MRO along with everything else.  This
will give us the best of all worlds.  Pure dynamic behaviour with high
performance.

> This is a big topic and I cannot devote the time needed. So to avoid
> confusing things by making suggestions when I only half understand
> what is going on.
> I will sit this one out.

That is no fun.  If everyone only made suggestions when they understood
everything it would be pretty quiet around here.  I apologize for booing
you.  I hope I didn't piss you off.  It was meant as a good boo. :-)  As
Christian said we are all looking at this from different views.  You are
probably right anyway.  I'll just never admit it. :-)

Even when we are somewhat wrong, we trigger thinking in our defending of
positions.  I learned a lot about Python and about how much Prothon's
interpreter was really like Python's.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.