ryancrawcour / cosmosdb-graph-bulkexecutor

Working with the Cosmos DB BulkExecutor for Gremlin Graphs
MIT License
0 stars 1 forks source link

Consider alternatives to reflection #2

Open ryancrawcour opened 4 years ago

ryancrawcour commented 4 years ago

The reflection approach, while quicker to bang out, is going to be quite costly on a per call basis. If you switched to building out expressions trees and baking/caching delegates you could pay those costs one time per type and eliminate almost all ongoing runtime costs on subsequent calls.

Originally posted by @drub0y in https://github.com/ryancrawcour/cosmosdb-graph-bulkexecutor/pull/1#issuecomment-542396034

hannesne commented 4 years ago

Expression trees is used to read the dynamic values in #7

ryancrawcour commented 4 years ago

Thanks. That's only for Dynamic objects, right? The rest still uses Reflection?

hannesne commented 4 years ago

Yeah only dynamic. I didn't change the approach for regular reads. I'm not sure if using expression trees will be vastly different, as you still need to use the reflection component to determine the name of the property you want to read.