Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: Low performance while serializing large OData feeds [1183]

$
0
0
```
public class ProductsController : ODataController
{
//[Queryable(PageSize = 10)]
public IQueryable<Product> Get()
{
return Product.Resources.AsQueryable();
}
}

public class Product
{
public int ID { get; set; }
public string Name { get; set; }
public decimal Price { get; set; }
public string Category { get; set; }

public virtual List<Supplier> Suppliers { get; set; }

public Product()
{
this.Suppliers = new List<Supplier>();
}

static private List<Product> resources;

static public List<Product> Resources
{
get
{
if (resources == null)
{
resources = new List<Product>();
for (int i = 0; i < 3000; i++)
{
resources.Add(new Product { ID = i, Name = "product" + i, Price = 45.0M, Category = "food" });
}
}

return resources;
}
}
}

public class Supplier
{
public string Name { get; set; }
public string EmailId { get; set; }

public List<Product> Products { get; private set; }

public Supplier()
{
this.Products = new List<Product>();
}

static public List<Supplier> Resources = new List<Supplier>()
{
new Supplier() { Name = "Contoso", EmailId = "president@contoso.com" },
new Supplier() { Name = "Fabrikam", EmailId = "president@fabrikam.com" },
};
}
```

Serializing the Products feed without page size has low performance of around 40 requests/sec.
Comments: No regressions

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>