Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give option to use much faster NativeParser over XmlReaderParser #229

Closed
skylord123 opened this issue Nov 12, 2019 · 1 comment · Fixed by #230
Closed

Give option to use much faster NativeParser over XmlReaderParser #229

skylord123 opened this issue Nov 12, 2019 · 1 comment · Fixed by #230

Comments

@skylord123
Copy link
Contributor

skylord123 commented Nov 12, 2019

In the InfusionsoftSerializer.php file it is using fXmlRpc to decode XML but currently it will only use the XmlReaderParser provided by fXmlRpc instead of being able to use the MUUCHHH faster NativeParser.

It would be nice to have some sort of option we can set so that whenever the fXmlRpc\Client object is created it passes the NativeParser.

Here are just some speed tests I did on the two parsing methods pulling 1000 customer records (10 requests each with how many seconds they took):

NativeParser:

array:10 [▼ 0 => 3.8508818149567
  1 => 1.8759288787842
  2 => 2.9604659080505
  3 => 1.8513948917389
  4 => 2.8992559909821
  5 => 5.1734600067139
  6 => 2.0731549263
  7 => 1.8135409355164
  8 => 1.8981981277466
  9 => 3.6245529651642 ]

XmlReaderParser:

array:10 [▼ 0 => 4.3948888778687
  1 => 5.4118418693542
  2 => 5.8395040035248
  3 => 5.62322306633
  4 => 5.4531991481781
  5 => 5.6922590732574
  6 => 4.7860569953918
  7 => 5.6059608459473
  8 => 5.5842728614807
  9 => 4.695662021637 ]

Now those timings include the request to Infusionsoft so here are two timings I did on just the parse() call:

NativeParser: 0.16266489028931
XmlReaderParser: 2.1137549877167

Even though the fXmlRpc docs say it's only 2x slower this is showing it is 12x slower. That is pretty ridiculous. If you are using this library for any sort of sync jobs with lots of data this can have quite a performance hit.

EDIT: I get that some people wont be able to install the xmlrpc module so that is why I recommend making it an option just like how the fXmlRpc library made it an option.

@skylord123
Copy link
Contributor Author

Instead of making it an option I just created a PR that will always use the faster NativeProcessor as long as the xmlrpc module is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant