Is using LINQ allowed?
I have been using LINQ in parts of my game.
It is mentioned in the Oculus guide to avoid LINQ, I have the two below bits of code, both do the same job. I have done some performance tests on a 1 million iterations of the below. The LINQ executed 15,000 times per second and the NoneLinq 45,000 time per second. Obviously none LINQ is quicker. But still 15,000 time per second is pretty quick. I prefer the tidiness, readability and ease of development from LINQ. I would however avoid using in Update(), but this executes once on a button press. I must admit I'm not 100 sure on the garbage generated from either.
Thoughts on using LINQ?
Do Oculus allow LINQ in submissions or is it a complete no no?
Any advice on the garbage created from one to the other?
It is mentioned in the Oculus guide to avoid LINQ, I have the two below bits of code, both do the same job. I have done some performance tests on a 1 million iterations of the below. The LINQ executed 15,000 times per second and the NoneLinq 45,000 time per second. Obviously none LINQ is quicker. But still 15,000 time per second is pretty quick. I prefer the tidiness, readability and ease of development from LINQ. I would however avoid using in Update(), but this executes once on a button press. I must admit I'm not 100 sure on the garbage generated from either.
Thoughts on using LINQ?
Do Oculus allow LINQ in submissions or is it a complete no no?
Any advice on the garbage created from one to the other?
public bool checkPlayerShipPartExists(string shipPart)
{
if (setupBoardlist.Count(x => x.SP.shipPart == shipPart) > 0)
{
return true;
}
return false;
}
public bool checkPlayerShipPartExistsNoneLinq(string shipPart)
{
for(int x = 0; x < setupBoardlist.Count; x++ )
{
if (setupBoardlist.SP.shipPart == shipPart)
{
return true;
}
}
return false;
}
Thanks
Thanks
