murugamsm / xmlrpcnet

Automatically exported from code.google.com/p/xmlrpcnet
0 stars 0 forks source link

Deserialization Performance Enhancement #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Performance from Smel:

I use CookComputing.XmlRpcV2.dll, and very slow working
*function XmlNode[] SelectNodes(XmlNode node, string name)
*in file XmlRpcSerializer.cs
original code
  XmlNode[] SelectNodes(XmlNode node, string name)
  {
    ArrayList list = new ArrayList();
    XmlNodeList nodes = node.ChildNodes;
    /*for (int i = 0; i < nodes.Count; i++)*/
    {
      if (*nodes[i]*.Name == name)   //exponent if i want 1000 node i need
go in node 1, after node 2, ... node 1000
        list.Add(nodes[i]);
    }
    return (XmlNode[])list.ToArray(typeof(XmlNode));
  }
you can changed on this
XmlNode[] SelectNodes(XmlNode node, string name)
  {
    ArrayList list = new ArrayList();
    XmlNodeList nodes = node.ChildNodes;
    /*foreach(XmlNode selnode in nodes)*/
    {
        if (selnode.Name == name)
            list.Add(selnode);               }
    return (XmlNode[])list.ToArray(typeof(XmlNode));
  }
in my program changet SelectNodes wokr <1sec, in original >10.

Original issue reported on code.google.com by ChasC...@gmail.com on 1 Nov 2008 at 5:34

GoogleCodeExporter commented 8 years ago
Implemented in revision 76.

Original comment by ChasC...@gmail.com on 20 Dec 2008 at 2:19