tomerfiliba-org / rpyc

RPyC (Remote Python Call) - A transparent and symmetric RPC library for python
http://rpyc.readthedocs.org
Other
1.56k stars 244 forks source link

Reducing Network Traffic and Misc Performance Considerations #326

Open comrumino opened 5 years ago

comrumino commented 5 years ago

229 and #304 suggest more attention should be paid to resource acquisition and release mechanisms. #304 is confirmed and #229 is a bit inconclusive. #294 suggests there is room for improvement as well. Benchmarks would allow for incremental improvements in these areas.

TODO:

  1. 331 integer results 295 bytes of traffic

  2. 329 big data issues

  3. 294 general chattiness

  4. 229 inconclusive jython leak

comrumino commented 4 years ago

Tracking #294 #295 #301 #331 #363 Considerations

Docstring test patch

331 enhancement

index 33513ac..47f0b10 100644
--- a/rpyc/lib/__init__.py
+++ b/rpyc/lib/__init__.py
@@ -182,5 +182,5 @@ def get_methods(obj_attrs, obj):
         attrs.update(basecls.__dict__)
     for name, attr in attrs.items():
         if name not in obj_attrs and hasattr(attr, "__call__"):
-            methods[name] = inspect.getdoc(attr)
+            methods[name] = ''
     return methods.items()

Traffic Generation

import time
import rpyc
from rpyc.utils.server import OneShotServer
import unittest

class MyService(rpyc.Service):

    def exposed_foo(self, i):
        return i

class Test_Bandwidth(unittest.TestCase):

    def setUp(self):
        self.server = OneShotServer(MyService, port=18878, auto_register=False)
        self.server.logger.quiet = False
        self.server._start_in_thread()

    def tearDown(self):
        self.server.close()

    def test_server_stops(self):
        conn = rpyc.connect("localhost", port=18878)
        for i in range(1, 1000):
            self.assertEqual(1, conn.root.foo(1))
        conn.close()

if __name__ == "__main__":
    unittest.main()
comrumino commented 4 years ago

Another data transfer performance issue reported.

comrumino commented 3 years ago

Throughput benchmark graphs for several cases are available in #398