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

Replace xml_stream with exml #183

Merged
merged 24 commits into from
Oct 15, 2015
Merged

Replace xml_stream with exml #183

merged 24 commits into from
Oct 15, 2015

Conversation

fenek
Copy link
Member

@fenek fenek commented May 9, 2014

This is a reincarnation of Rafał's exml branch. The original was too difficult for rebase/merge with current master. :( We can compare performance of modern exml and MongooseIM with xml_stream-based version. Perhaps with this we could avoid virtually duplicating functionality in another C module?

@erszcz
Copy link
Member

erszcz commented May 9, 2014

Looks good to me, though I didn't test the changes.

@fenek
Copy link
Member Author

fenek commented May 9, 2014

Shouldn't be merged yet, I'm doing load tests first. :)

gen_fsm:send_event(C2SPid, {xmlstreamerror, "XML stanza is too big"});
true ->
if
element(1, Elem) == xmlel ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that pattern matching in a case like following would be more readable (in my opinion)

case Elem of
    #xmlel{} ->
        gen_fsm:send_event(C2SPid, {xmlstreamelement, Elem});
    _ ->
        gen_fsm:send_event(C2SPid, Elem)
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. And it involves including exml.hrl, so to maintain consistency all element(1, X) in ejabberd_receiver should be replaced.

@michalwski
Copy link
Contributor

This pull request refers to #178

@michalwski
Copy link
Contributor

A tip: let's put issue number in the commit message (if issue exists of course)

@michalwski
Copy link
Contributor

Any diagrams you can put here to prove that exml is more stable/efficient? I know you have something, don't hide it :)

BTW, please rebase to master :)

@fenek
Copy link
Member Author

fenek commented May 20, 2014

I want to double-check if it was valid result. I was experimenting with various VM versions (for benchmarking and segfault debugging) and I might have made some mistake. :P

@fenek
Copy link
Member Author

fenek commented May 20, 2014

I must have done something wrong last time. Final tests reveal that there is no difference in terms of performance. The only benefit is cleaner source code (C modules handling XML kept in one application). Will we even merge it after rebase?

@michalwski
Copy link
Contributor

I know it's been a long time but we finally came into conclusion that this change is worth merging. Could you rebase it or make it "green" for merge in other way?

@fenek
Copy link
Member Author

fenek commented Dec 16, 2014

OK, will do it during some pause in commercial work. Should be quite soon actually.

@pzel
Copy link
Contributor

pzel commented Dec 16, 2014

on it

@michalwski
Copy link
Contributor

@pzel, any progress?

@pzel
Copy link
Contributor

pzel commented Jan 9, 2015

I spent some time analyzing the security implications (cdata flood & c2s shaper functionality) and I'm not certain we can proceed without tests and security analysis. I'll file an issue with esl/exml.

@pzel
Copy link
Contributor

pzel commented Aug 12, 2015

Until this serious exml bug is fixed, we should put the project on hold.

@michalslaski michalslaski added this to the MongooseIM 1.6 milestone Sep 14, 2015
@ppikula ppikula force-pushed the exml-v2 branch 2 times, most recently from e245d15 to 68c678a Compare September 16, 2015 15:36
@michalwski
Copy link
Contributor

Fixes #414

@ppikula ppikula force-pushed the exml-v2 branch 5 times, most recently from 153a240 to 7a4ea6d Compare September 24, 2015 10:26
@ppikula
Copy link
Contributor

ppikula commented Sep 24, 2015

Performance comparison against master branch: https://snapshot.raintank.io/dashboard/snapshot/prLZfftfcq2XhSflK8LcbyiqZZ0tITey

First run - master,
Second - this PR

@studzien
Copy link
Contributor

michalwski added a commit that referenced this pull request Oct 15, 2015
Replace xml_stream with exml
@michalwski michalwski merged commit 2ac5ad2 into master Oct 15, 2015
@michalwski michalwski mentioned this pull request Oct 15, 2015
@ppikula ppikula deleted the exml-v2 branch October 26, 2015 07:34
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

Successfully merging this pull request may close these issues.

7 participants