SamSaffron/dapper-dot-net — pull request #58 by mrange (2012-10-21 18:52:58+00:00)
Title: Dapper row

Hi.

As discussed per email this pull request is about replacing/deprecating FastExpando with DapperRow/DapperTable.

The rationale for this is:
1. Create performance
2. Reduced memory footprint

DapperRow/DapperTable achieves this by tracking the field column names in DapperTable thus only creating the Dictionary lookup for field names once. All DapperRows relay lookups to DapperTable. When creating a DapperRow the only things that is done is creating an Array of right size and populating it (using GetValues() if all values are needed, otherwise iterating and Calling GetValue()).

Create performance from my measuring seems improved by around 15 times (100,000 DapperRows are created in 60 ms compared to ~1 sec with FastExpando). How much this reduction in overhead adds in useful performance when adding the overhead of getting rows from a the DB is uncertain but IMHO reducing waste of clockcycles is a good thing. The reduced memory footprint is a bonus and a bit hard to measure.

The pull request is complicated a bit by FastExpando support IDictionary<> which complicates the code in DapperRow but DapperRow does now support IDictionary<>. The unit test in the current pull request is potentially too low in this regard though.