Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Dynamic Wiki | Download | Examples
Dynamic allows developers to use truly dynamic data structures in SourcePawn. This means you can define a Methodmap and use Dynamic to back it's member data at run-time. All dynamic members are typed which allows automatic type conversion between base types. You can then extend and inherit Dynamic Methodmaps to build complex namespaces. Namespaces simplify the sharing of complex structures which third party plugins can easily access with a minimal amount of code. Features - Fully methodmap based to try and give an Object Orientated feel - Inherit Dynamic to make your own simple methodmaps - Easily name and retrieve dynamic objects between multiple plugins (no natives required)!!!! - Supports String, int, float, bool, Handle, Vector and Dynamic types - Automatic type conversion!! - Static objects for Server and Player Settings - Hook member changes - Member iteration / looping - Member sorting - Load and Save flat configs - Load and Save KeyValue configs Dynamic Methodmaps - Extend Dynamic to create your own Dynamic methodmaps - A Class Builder to quickly generate basic Dynamic methodmaps - You dont have to muck around with Dynamic Member Offsets to improve performance - All of the same features that come with Dynamic Objects Planned Changes - Add serialisation support using mysql Download (v0.0.32) Example Use + Features Example Class Use Example Class Example Class Builder Include File |
Re: Dynamic Objects and Properties
Very cool, Will save me a lot of time instead of using natives all the time :P
|
Re: Dynamic Objects and Properties
I've done some profiling of the current version attached to the OP.
Here is the profiling code:
Spoiler
Code:
[SM] Starting Benchmark Tests... |
Re: Dynamic Objects and Properties
1 Attachment(s)
I've made a second version.
The main idea was to try and speed up Create/Update member operations. The internal data for each object is one array, rather than 3 arrays (one for each type (int, float, string)). The member name is also contained in the data, where as the first version has a lookup array that points to the members position in the data array (1 per type again). Code:
[SM] Starting Benchmark Tests... I also believe lots of the internal functions are passing around arguments that could be static. Version 002 is attached to this post. If anyone has any idea's or suggestions on how to go about making this as optimised as possible, I'm all ears! |
Re: Dynamic Objects and Properties
Cool stuff
|
Re: Dynamic Objects and Properties
Quote:
|
Re: Dynamic Objects and Properties
Quickly. Get him before he leaves lol
Edit: on topic. I done another version which is heaps faster! |
Re: Dynamic Objects and Properties
1 Attachment(s)
Version 003.
I'm using a Trie for member lookups and arrays for data storage. It's up to 10 times faster. The Trie holds the offset for where the members data is held in the internal array. Code:
[SM] Starting Benchmark Tests... |
Re: Dynamic Objects and Properties
Wow thank you for this, this is exactly what I have been needing for my plugin. I am correct in saying it works just like any other data type in that I can have an array of them like
Code:
Dynamic object[32] |
Re: Dynamic Objects and Properties
You sure can :)
Edit: remember to initialise them as per the first post |
All times are GMT -4. The time now is 13:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.