comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Tell whether a primitive subprogram was overridden
Date: Tue, 19 Aug 2014 18:54:25 +0300
Date: 2014-08-19T18:54:25+03:00	[thread overview]
Message-ID: <lsvrve$g86$1@speranza.aioe.org> (raw)
In-Reply-To: 17wr6psgtju81$.vcio92x50jpn$.dlg@40tude.net

Dmitry A. Kazakov wrote:

> On Tue, 19 Aug 2014 16:45:54 +0300, Victor Porton wrote:
> 
>> Dmitry A. Kazakov wrote:
> 
>>> You mean that a check would be more efficient than a dispatching call? I
>>> don't think there would be much difference, except the case when the
>>> subprogram has a long list of additional arguments or computed
>>> arguments. That is usually the case when doing tracing stuff. In that
>>> case you could think of some lazy parameter evaluation schema or upfront
>>> checks as Adam suggested.
>> 
>> No. I haven't described exactly what I do.
>> 
>> I need to register (by calling a C function) a C wrapper around a method
>> of my class as a callback subprogram. If my method is null, it is not
>> necessary to register it and the C code would not call it.
> 
> You certainly register it only once. Therefore it is indeed the overhead
> of a single dispatching call = a couple of nanoseconds. If you are in this
> area you should look at C code as well. It checks if something is
> registered. The depending on the choice it does a jump or no jump. Jump is
> also a nanosecond of so.

No, I register it either once or zero times.

If it is not registered, the program is a little faster.

-- 
Victor Porton - http://portonvictor.org


      reply	other threads:[~2014-08-19 15:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18 23:41 Tell whether a primitive subprogram was overridden Victor Porton
2014-08-18 23:52 ` Adam Beneschan
2014-08-18 23:57   ` Victor Porton
2014-08-19  9:50     ` Simon Wright
2014-08-19  1:29   ` Shark8
2014-08-19  7:31 ` Dmitry A. Kazakov
2014-08-19 13:45   ` Victor Porton
2014-08-19 13:57     ` Dmitry A. Kazakov
2014-08-19 15:54       ` Victor Porton [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox