Comments (3)
Tiny.Rtti is undoubtedly faster than System.Rtti but that benchmark is comparing apples and oranges. It tests the rather high level TRttiMethod.Invoke that also uses TValue against the rather low level Tiny.Invoke where you need to mess around with pointers and stuff to do the invoke call.
And it even cheats by putting some of the work Tiny.Rtti has to do for the Invoke call outside of the measured loop!
If you want to make invocations via System.Rtti faster then use the Invoke Routine that avoids all the additional stuff happening in TRttiMethod.Invoke/DispatchInvoke but then you need to take care about all the low level parameter passing mechanisms yourself similar to Tiny.Rtti where you just pass the TRttiInvokeDump record representing registers and stack. That would rather be comparable with the implementation only routine RawInvoke from System.Rtti.
If I test System.Rtti.Invoke(LMethod.CodeAddress, [Self, 1, 2, 3], LMethod.CallingConvention, nil);
against a non cheated Tiny.Rtti I get a difference of 5 to 1.
Additional fun fact: in my test using OptimalInvokeFunc was approx 5-10% slower than using UniversalInvokeFunc
from delphi-event-bus.
@d-mozulyov, comments by sglienke FYI :)
from delphi-event-bus.
The key difference is that the number of calculations is minimized, the main calculations occur at the signature analysis stage.
I also draw attention to the fact that Tiny.Rtti is not yet a full-fledged replacement for System.Rtti. Wait for new releases.
from delphi-event-bus.
Related Issues (20)
- lock in eventbus class is a class var HOT 2
- consider making arguments const that are of managed types such as interface, string, TValue and so on HOT 1
- You are mistakenly attributing some code to me that is not HOT 1
- Error invoking subscriber method. Subscriber class: <something> . Original exception: EInvalidCast: Invalid class typecast HOT 33
- Error Undeclared TEventBusFactory HOT 4
- Hang on splash screen HOT 8
- Minor improvement of subscriber registration HOT 3
- REQUEST: Set Context on registration HOT 19
- Faster MREW for DEB ? HOT 8
- Remove dependency on DUnitX.Utils HOT 1
- Threading issues with asynchronous messaging to inactive subscription HOT 5
- Request/Reply pattern HOT 2
- [Question] "Active" property in TSubscription - how to use it? HOT 3
- TList inside posted event objects empties on Delphi 11 Alexandria HOT 2
- The project's headed to the wrong direction, unfortunately... HOT 6
- SubscribeAttribute in public, protected and private methods.
- DEB on Android HOT 2
- Crashes galore on theme change HOT 4
- Background / Async tasks deadlock HOT 1
- Question: Explanation/Examples for TThreadMode Subscriptions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delphi-event-bus.