Closed psorowka closed 7 years ago
Great work, again! Nothing more to add. Thanks!
Cool, thanks for the quick response!
Hey @psorowka,
i made you a collaborator for this repository, so you can create branches in this repository for pull requests next time.
While analyzing a memory leak (in our code) we learned that this lib had two major optimization potentials, especially regarding the
reqFifo
. This Pull Request solves both of these (details below) by replacing the Promise libraryQ
with its more performant counterpartbluebird
and completely removes thePut
dependency (which hasn't been touched for the last 5 years anyway).Details:
we had a situation where requests where queueing in huge amounts leading to an out-of-memory error. While the fact that the requests where queuing is our fault, the memory usage was much higher than we thought it should be. We therefore created the following minimal test (against a locally running mock modbus server):
the result:
after replacing
Q
withbluebird
(only inreadCoils
for this test)after getting rid of
Put
in favor of pureBuffer
(also only inreadCoils
for this test)after consequently updating the whole lib with these new findings (=> the current PR), it went even further down: