I tried to execute your code from BasicExample on LinqExample.cs and first your comment triggered me cause for me Linq has always been slower than any other much basic stuff like a foreach.
Cause behind all the Linq process, there is only some foreach loop + some useless allocation that are avoided from a custom foreach iteration.
So I decided to execute your basic example in 2 differents cases and here are my results :
VS2017 / .NET 4.6.1 on SampleHouse.ifc file :
VS2017 / .NET 4.6.1 on Lakeside.ifc :
I tried in Unity too but it seems to be altered by my issue with the IfcStore.Open method which take a lot of time but even on Unity the difference is roughly one seconds between both methods for a result of 15sec with Linq and 16 without Linq which is odd.
I tried to execute your code from BasicExample on LinqExample.cs and first your comment triggered me cause for me Linq has always been slower than any other much basic stuff like a foreach. Cause behind all the Linq process, there is only some foreach loop + some useless allocation that are avoided from a custom foreach iteration.
So I decided to execute your basic example in 2 differents cases and here are my results : VS2017 / .NET 4.6.1 on SampleHouse.ifc file :
VS2017 / .NET 4.6.1 on Lakeside.ifc :
I tried in Unity too but it seems to be altered by my issue with the IfcStore.Open method which take a lot of time but even on Unity the difference is roughly one seconds between both methods for a result of 15sec with Linq and 16 without Linq which is odd.
Have you any proof of this Linq 4.5x slower ?