Click here to Skip to main content
15,883,705 members
Articles / Programming Languages / C#

HyperDescriptor: Accelerated dynamic property access

Rate me:
Please Sign up or sign in to vote.
4.96/5 (57 votes)
20 Apr 20077 min read 224.6K   3.2K   155  
Provides a vastly accelerate runtime property implementation that can be applied even to closed-source classes
Direct access
MyEntity.Name	GetValue	8ms
MyEntity.Name	SetValue	97ms
MyEntity.Name	ValueChanged	1022ms
OpCount: 25000000

Without HyperTypeDescriptionProvider
MyEntity.Name	GetProperties	647ms
MyEntity.Name	IsReadOnly	2926ms
MyEntity.Name	SupportsChangeEvents	245ms
MyEntity.Name	GetValue	10360ms
MyEntity.Name	SetValue	20288ms
MyEntity.Name	ValueChanged	29566ms
OpCount: 25000000
MySuperEntity.Name	GetProperties	828ms
MySuperEntity.Name	IsReadOnly	2881ms
MySuperEntity.Name	SupportsChangeEvents	241ms
MySuperEntity.Name	GetValue	10682ms
MySuperEntity.Name	SetValue	20730ms
MySuperEntity.Name	ValueChanged	30979ms
OpCount: 25000000
MySuperEntity.When	GetProperties	825ms
MySuperEntity.When	IsReadOnly	2888ms
MySuperEntity.When	SupportsChangeEvents	251ms
MySuperEntity.When	GetValue	11393ms
MySuperEntity.When	SetValue	22416ms
OpCount: 10000000

With HyperTypeDescriptionProvider
MyEntity.Name	GetProperties	699ms
MyEntity.Name	IsReadOnly	43ms
MyEntity.Name	SupportsChangeEvents	41ms
MyEntity.Name	GetValue	57ms
MyEntity.Name	SetValue	155ms
MyEntity.Name	ValueChanged	954ms
OpCount: 25000000
MySuperEntity.Name	GetProperties	914ms
MySuperEntity.Name	IsReadOnly	41ms
MySuperEntity.Name	SupportsChangeEvents	44ms
MySuperEntity.Name	GetValue	95ms
MySuperEntity.Name	SetValue	173ms
MySuperEntity.Name	ValueChanged	1059ms
OpCount: 25000000
MySuperEntity.When	GetProperties	891ms
MySuperEntity.When	IsReadOnly	41ms
MySuperEntity.When	SupportsChangeEvents	46ms
MySuperEntity.When	GetValue	295ms
MySuperEntity.When	SetValue	110ms
OpCount: 10000000

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer Stack Exchange
United Kingdom United Kingdom
Geek at Stack Exchange

Comments and Discussions