beetle1.1性能测试报告
这是针对beetle1.1进行的性能测试结果,其性能会比1.0有接近15%的提高,分别针对单一对象请求应答和列表对象请求应答来进行一个性能对比。
单一对象结构:
class User : IMessage { public string Name; public string EMail; public string City; public string Counrty; public void Save(BufferWriter writer) { writer.Write(Name); writer.Write(EMail); writer.Write(City); writer.Write(Counrty); } public void Load(BufferReader reader) { Name = reader.ReadString(); EMail = reader.ReadString(); City = reader.ReadString(); Counrty = reader.ReadString(); } }
列表对象结构:
class Order : Beetle.IMessage { public int OrderID; public string CustomerID; public int EmployeeID; public long OrderDate; public long RequiredDate; public string ShipName; public string ShipAddress; public string ShipCity; public string ShipRegion; public string ShipPostalCode; public string ShipCountry; public void Save(BufferWriter writer) { writer.Write(OrderID); writer.Write(CustomerID); writer.Write(EmployeeID); writer.Write(OrderDate); writer.Write(RequiredDate); writer.Write(ShipName); writer.Write(ShipAddress); writer.Write(ShipCity); writer.Write(ShipRegion); writer.Write(ShipPostalCode); writer.Write(ShipCountry); } public void Load(BufferReader reader) { OrderID = reader.ReadInt32(); CustomerID = reader.ReadString(); EmployeeID = reader.ReadInt32(); OrderDate = reader.ReadInt64(); RequiredDate = reader.ReadInt64(); ShipName = reader.ReadString(); ShipAddress = reader.ReadString(); ShipCity = reader.ReadString(); ShipRegion = reader.ReadString(); ShipPostalCode = reader.ReadString(); ShipCountry = reader.ReadString(); } } Response response = new Response(); for (int i = 0; i < 5; i++) { Order order = new Order(); order.OrderID = 10248; order.CustomerID = "WILMK"; order.EmployeeID = 5; order.OrderDate = 629720352000000000; order.RequiredDate = 629744544000000000; order.ShipAddress = "59 rue de l'Abbaye"; order.ShipCity = "Reims"; order.ShipCountry = "France"; order.ShipName = "Vins et alcools Chevalier"; order.ShipPostalCode = "51100"; order.ShipRegion = "RJ"; response.Orders.Add(order); } adapter.Send(response);
测试结果:
http://beetle.henryfan.net
转载于:https://www.cnblogs.com/smark/archive/2012/03/09/2387219.html