Re: optimization (2nd attempt)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: optimization (2nd attempt)

paolo.bernardi.67@gmail.com
Sorry, I'm not so smart when quoting...

Il 24/11/2013 15.39, Levente Uzonyi wrote:

> Since message sends are late bound, it means that if you want to cache
> something, then you have to do it yourself.

I know (or I think I know) what late binding means,
but I can't figure the connection with the topic of caching the return
value.
In other words: if st was NOT late binding, things were different about
the to cache or not to cache some return value?
Can you clear to me the idea?

molte grazie (= many thanks)

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: optimization (2nd attempt)

Nicolas Cellier
paolo.bernardi.67 <at> gmail.com <paolo.bernardi.67 <at> gmail.com> writes:

>
> Sorry, I'm not so smart when quoting...
>
> Il 24/11/2013 15.39, Levente Uzonyi wrote:
>
> > Since message sends are late bound, it means that if you want to cache
> > something, then you have to do it yourself.
>
> I know (or I think I know) what late binding means,
> but I can't figure the connection with the topic of caching the return
> value.
> In other words: if st was NOT late binding, things were different about
> the to cache or not to cache some return value?
> Can you clear to me the idea?
>
> molte grazie (= many thanks)
>


As Levente said it: the implementation of Time could change entirely, such
that previous instance of Time could loose their meaning (for example, you
add/removed/renamed some instance variables, or changed expected interface
for those inst. var.).

If Time can change, then you'd better not create potentially obsolete
instances in advance.

If you have a version of asTime that you can guaranty unchanged, then you
can perform early binding, that is immediately evaluate the message send to
the constant, and hardcode the result of message sent as another constant...

But even with such early binding, things could go tricky, what should this
respond?

^'6:30am' asTime class allInstances size

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners