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

XML serialisation performance vs. SimpleXML? #606

Closed
steffenschumacher opened this issue Jul 6, 2016 · 4 comments
Closed

XML serialisation performance vs. SimpleXML? #606

steffenschumacher opened this issue Jul 6, 2016 · 4 comments

Comments

@steffenschumacher
Copy link

Hi,
Just wondering if any tests have been conducted on the above?
This project is used by xsd2php, where XSD generated PHP classes can be serialised into XML using serializer, and I really need performance - both for un/marshalling.
So if any comparisons have been made, then I would be keen to know the ballpark outcome?

@goetas
Copy link
Collaborator

goetas commented Jul 7, 2016

i tried to explore the idea... but without real tests...
simplexml will improve the memory usage, but im not really sure about cpu performance (but will make the serializer a bit more complex).
probably there are rooms for improvements anyway keeping the dom serializer.

@steffenschumacher
Copy link
Author

Not sure I understand:

but will make the serializer a bit more complex
What I was thinking (in no way to the end), was if the php-classes generated by xsd2php, could include autogenerated code to un/marshal objects from/to XML, using simpleXML?
This way, xsd2php would have no dependency towards serializer and the generated classes could be used without any dependencies at all.
Automatically building the methods for un/marshalling on each class would be quite complex of course..
I'll close the question - thanks!

@goetas
Copy link
Collaborator

goetas commented Aug 1, 2016

could include autogenerated code to un/marshal objects from/to XML, using simpleXML?

this will violate SRP and generally IMO is a bad idea.

Automatically building the methods for un/marshalling on each class would be quite complex of course..

I will add also that the code obtained from it can not be re used in any context.

@steffenschumacher
Copy link
Author

Right - I guess one approach could be to add more meta data onto the classes, so that a separate module could deal with in/marshaling- kinda like how JAXB works for Java..

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

No branches or pull requests

2 participants