|
Post by darknesssimplify on Nov 11, 2018 16:59:52 GMT -5
S4Studio.Data.PackageResourceProviderBase.Findall decompiles to the following code (I presume from a query comprehension statement): public override IEnumerable<IResourceHandle> FindAll(uint? type_id = null, uint? group_id = null, ulong? instance_id = null, string name = null, bool exact_name = false)
{
IQueryable<IDBPFResourcePointer> source;
if (type_id != null)
{
source = this.Package.FindAllByType(type_id.Value).AsQueryable<IDBPFResourcePointer>();
}
else
{
source = this.Package.FindAll().AsQueryable<IDBPFResourcePointer>();
}
if (group_id != null)
{
source = source.Where(x => (uint?)x.Group == group_id);
}
if (instance_id != null)
{
source = source.Where(x => (ulong?)x.Instance == instance_id);
}
return source.Select(x => new PackageResourceProviderBase.PackageResourceHandle(this, x));
} Unfortunately, AsQueryable is a fairly expensive operation. For me, selecting an object in My CC takes about 10.5 seconds to execute, 92% of which is executing the AsQueryable, which I verified by editing the code to remove the AsQueryable calls, giving me a tremendous performance improvement. ( andrew since I can't post this somewhere more appropriate)
|
|