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

rpc: handle XML-RPC with JSON-RPC logics #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jesec
Copy link
Owner

@jesec jesec commented Jul 3, 2023

This allows us to centralize on a single set of RPC logics, sharing the exception handling, error codes/messages and behaviors.

This improves consistency, reduces maintenance burden, makes future extension to RPC parts easier. In addition, we can ditch the dependency on decade-old xmlrpc-c library.

As for the performance, we performed a test with 10,000 torrents in a typical d.multicall2 call, which showed JSON-RPC is 3x faster, compared to XML-RPC (xmlrpc-c). Meanwhile, rapidxml is 3-9x faster, compared to expat/libxml. That means even with the conversion, we shouldn't see much of a performance ding. We may even have a win.

This allows us to centralize on a single set of RPC logics, sharing
the exception handling, error codes/messages and behaviors.

This improves consistency, reduces maintenance burden, makes future
extension to RPC parts easier. In addition, we can ditch the dependency
on decade-old xmlrpc-c library.

As for the performance, we performed a test with 10,000 torrents in
a typical d.multicall2 call, which showed JSON-RPC is 3x faster,
compared to XML-RPC (xmlrpc-c). Meanwhile, rapidxml is 3-9x faster,
compared to expat/libxml. That means even with the conversion, we
shouldn't see much of a performance ding. We may even have a win.
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage: 1.58% and project coverage change: -0.85 ⚠️

Comparison is base (88fd968) 7.95% compared to head (5ae8972) 7.11%.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #65      +/-   ##
=========================================
- Coverage    7.95%   7.11%   -0.85%     
=========================================
  Files         162     171       +9     
  Lines       10497   12006    +1509     
=========================================
+ Hits          835     854      +19     
- Misses       9662   11152    +1490     
Impacted Files Coverage Δ
include/rpc/rpc_json.h 0.00% <ø> (ø)
include/utils/rapidxml/rapidxml.hpp 0.00% <ø> (ø)
include/utils/rapidxml/rapidxml_print.hpp 0.00% <0.00%> (ø)
src/rpc/rpc_json.cc 0.00% <0.00%> (ø)
src/rpc/rpc_xml.cc 0.00% <0.00%> (ø)
src/rpc/scgi.cc 0.00% <0.00%> (ø)
include/rpc/rpc_xml.h 28.57% <33.33%> (+28.57%) ⬆️
src/rpc/rpc_manager.cc 25.00% <100.00%> (+1.74%) ⬆️

... and 16 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kannibalox
Copy link
Contributor

Is there room for a shim for system.multicall? I can take a stab at it myself if needed.

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.

2 participants