Sep 29, 2014, 11:31 AM
[CLOSED] Question about performance
Example code:
Ext.Net, Version=1.2.0.19755, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87
N:100 Avg:0,408164 Time:40,8164
Ext.Net, Version=1.7.0.0, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87
N:100 Avg:0,401263 Time:40,1263
Ext.Net, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87
N:100 Avg:0,683862 Time:68,3862
Ext.Net, Version=2.5.2.10697, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87
N:100 Avg:0,797429 Time:79,7429
Serialization of equialent object is much faster (10-100 times).
Is there any ways to increase performance of ToConfig?
What causes such a drawdown performance?
protected void Page_Load(object sender, EventArgs e)
{
var n = 100;
var sw = Stopwatch.StartNew();
var sb = new StringBuilder();
for (int i = 0; i < n; i++)
{
var mi = new MenuItem("Some text in MI " + i);
mi.DirectEvents.Click.Url = "/Myurl";
mi.DirectEvents.Click.ExtraParams.Add(new Parameter("p1", "nn" + Guid.NewGuid()));
var cfg = mi.ToConfig();
sb.Append(cfg);
sb.Append(",");
}
sw.Stop();
var result = string.Format("N:{1} Avg:{0} Time:{2} ",sw.Elapsed.TotalMilliseconds / n, n, sw.Elapsed.TotalMilliseconds);
var fn= typeof(MenuItem).Assembly.FullName;
form1.Controls.Add(new System.Web.UI.WebControls.Label() { Text = fn+ "<br/>" + result });
}
fairly simple js:{
id: "id626c18b1703505f0",
xtype: "menuitem",
text: "Some text in MI 0",
directEvents: {
click: {
fn: function(item, e) {
Ext.net.directRequest({
cleanRequest: true,
url: "/Myurl",
extraParams: {
"p1": "nn8ef994ea-63ce-42e0-9fde-9b885c185391"
},
control: this
});
}
}
}
}
Timings on different Ext.NET versions (on not very slow core i7-2600):Ext.Net, Version=1.2.0.19755, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87
N:100 Avg:0,408164 Time:40,8164
Ext.Net, Version=1.7.0.0, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87
N:100 Avg:0,401263 Time:40,1263
Ext.Net, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87
N:100 Avg:0,683862 Time:68,3862
Ext.Net, Version=2.5.2.10697, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87
N:100 Avg:0,797429 Time:79,7429
Serialization of equialent object is much faster (10-100 times).
Is there any ways to increase performance of ToConfig?
What causes such a drawdown performance?
Last edited by Daniil; Oct 07, 2014 at 5:43 AM.
Reason: [CLOSED]