• Stars
    star
    995
  • Rank 46,046 (Top 1.0 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automatically exported from code.google.com/p/fast-member

Fast access to .net fields/properties

In .NET reflection is slow... well, kinda slow. If you need access to the members of an arbitrary type, with the type and member-names known only at runtime - then it is frankly hard (especially for DLR types). This library makes such access easy and fast.

An introduction to the reasons behind fast-member can be found on my blog; example usage is simply:

var accessor = TypeAccessor.Create(type); 
string propName = // something known only at runtime 
while( /* some loop of data */ )
{ 
  accessor[obj, propName] = rowValue; 
}

or

// obj could be static or DLR 
var wrapped = ObjectAccessor.Create(obj);
string propName = // something known only at runtime 
Console.WriteLine(wrapped[propName]);

Ever needed an IDataReader?

This is pretty common if you are doing object-mapping between an object model and ADO.NET concepts such as DataTable or SqlBulkCopy; loading a DataTable (yes, some people still use it) from a sequence of typed objects can now be as easy as:

IEnumerable<SomeType> data = ... 
var table = new DataTable(); 
using(var reader = ObjectReader.Create(data)) 
{ 
  table.Load(reader); 
}

(the Create method offers parameters to control the specific members, if needed)

Or if you want to throw the data into a database as fast as humanly possible:

using(var bcp = new SqlBulkCopy(connection)) 
using(var reader = ObjectReader.Create(data, "Id", "Name", "Description")) 
{ 
  bcp.DestinationTableName = "SomeTable"; 
  bcp.WriteToServer(reader); 
}

Ahead of Time

Library emits IL code during runtime. Will not work in constrained Ahead of Time environments. Xamarin iOS and Unity IL2CPP are such.

More Repositories

1

Pipelines.Sockets.Unofficial

.NET managed sockets wrapper using the new "Pipelines" API
C#
412
star
2

PooledAwait

Low allocation async/await for C#/.NET
C#
384
star
3

Pipelines.WebSockets

.NET WebSocket (RFC 6455/hixie/hybi) implementation using the System.IO.Pipelines API
C#
69
star
4

DistributedCacheDemo

basic example of helper APIs for IDistributedCache
C#
51
star
5

RESPite

Low level RESP handling tools for .NET, intended for consumption by other libraries
C#
32
star
6

SimpleCUDAExample

A basic example of using ManagedCUDA via C# to execute logic on the GPU
C#
31
star
7

SortOfProblem

A demo project discussion sorting
C#
29
star
8

FASTERCache

IDistributedCache implementation on FASTER
C#
28
star
9

pipelines.docs

Open source documentation for the .NET pipelines project
17
star
10

Channels.Http2

Investigation into HTTP/2 (RFC7540) over Channels
C#
12
star
11

SimpleLINQ

Simplified wrapper for implementing custom (but simple) LINQ providers
C#
6
star
12

blog-preview

Things before they are written
C#
6
star
13

avro.net

Avro; get some
C#
4
star
14

RedisPing

Scratch area for playing with redis
C#
4
star
15

PlatformDynamicMethod

C#
4
star
16

OutputCacheDemo

asp.net demo using redis-based outputcache
C#
3
star
17

pigrostat

A basic hygrostat implementation for pi pico, sht30 and relay hat, using MicroPython
Python
3
star
18

ProtobufMemoryExploration

C#
2
star
19

dkclient

Prototype demikernal client; highly experimental
C#
1
star
20

JsilFun

Test package for JSIL
JavaScript
1
star
21

dapperson

1
star
22

DraftBlogs

In progress blog posts, mostly for review by folks
1
star
23

PickTock

Python
1
star