Issue with extending OData by creating a custom OData formatter

Jan 20, 2014 at 3:19 PM
Edited Jan 20, 2014 at 6:02 PM
Based on information given at we tried to extend OData by creating own custom OData formatter.
Everything works now as expected except performance: a query to a database with many columns takes more than 10 or 15 seconds.
Our implementation consists of a custom ODataSerializerProvider that extends DefaultODataSerializerProvider and has a custom ODataEntityTypeSerializer with public override ODataEntry CreateEntry(SelectExpandNode selectExpandNode, EntityInstanceContext entityInstanceContext) method where we have our logic which changes an instance of SelectExpandNode (we replace names of columns there)

If we call a default implementation of DefaultODataSerializerProvider, results seems to be in cache after the first execution so the performance is ok. Even if we call our custom implementation with the base logic, where we just call :
        var entryTest = base.CreateEntry(selectExpandNode, entityInstanceContext);
        return entryTest;
the performance in this case is poor, it takes 2 or 3 seconds, default response comes in a less then 1 second.

Do we miss something?
Jan 21, 2014 at 11:36 AM
Sorry, that was my fault: injecting ILog and logging was an issue , performance loss had nothing to do with our custom ODataSerializerProvider
Marked as answer by boriska002 on 1/21/2014 at 4:36 AM
Jan 24, 2014 at 2:59 AM
Thanks for updating this answer and helping us avoid the wild goose chase :)