Vítejte na blog.vyvojar.cz Přihlásit | Registrovat | Pomoc

Ars programatica

Udělat dobrý sotware je řemeslo, udělat výjimečný software je umění
Rychlost volání delegátů

Cituji z (jinak velmi zajímavého, doporučuji k přečtení) článku The cost of enumerating in .NET:

Delegate dispatch still isn’t quite the speed of virtual method dispatch.  And delegates bound to static methods are actually slightly slower than those bound to instance methods, which is why you’ll notice a slight difference in the original “s” versus “i” measurements.  The reason is subtle.  There is a delegate dispatch stub that is meant to call the target method: when the delegate refers to an instance method, the ‘this’ reference pushed in EAX points to the delegate object when it is invoked and the stub can simply replace it with the target object and jump; for static methods, however, all of the arguments need to be “shifted” downward, because there is no ‘this’ reference to be passed and therefore the first actual argument to the static method must take the place of the current value in EAX.

Posted: Monday, September 22, 2008 11:20 AM by pbouda
Vedeno pod: , ,

Komentář

Ujo Jorge napsal:

A co z toho akoze vyplyva?

# September 25, 2008 3:08 PM

peter napsal:

Ked uz nic ine, tak aspon aky-taky preklad si mohol dat. Nie ze by som to ja nevedel precitat, ale mnoho ludi si mozno nie prave jednoducho prelozi dany text...

# September 30, 2008 9:13 AM

pbouda napsal:

Ujo Chorge: Pro každodenní praxi z toho zase až tak moc nevyplývá, ale je dobré vědět, s čím má člověk co do činění. A je dobré si občas připomenout, že počítač je stále počítač a má něco jako paměť, procesor, registry.

peter: Mohl jsem, ale nechtěl. Kdybych chtěl, tak to udělám ;-) Tak nějak jsem předpokládal, že si to každý přeloží. A to jsem dnes přemýšlel nad tím, zda nezačít psát anglicky, abych si rozšířil čtenářskou obec :)

# September 30, 2008 11:43 AM
Nejsou povoleny nové komentáře k tomuto příspěvku