Giter Site home page Giter Site logo

libindy-common-java's People

Contributors

bernhardfuchs avatar peacekeeper avatar

Watchers

 avatar  avatar  avatar

Forkers

dennisn00

libindy-common-java's Issues

Performance Improvement for openIndyConnections

As discussed here, I noticed that the Indy and Sov Drivers for the Universal Resolver take up to 3 minutes for the first Resolve Request, because all IndyConnections are only opened once the first request comes in.
As @peacekeeper mentioned in the issue linked above, there is two ways to solve this: Only open the connection for the pool requested or open the pools when the driver is started and speed up the opening.
I think the second option is preferable, because
a) it catches problems with the pool Configs during start and not only when the pool is actually queried
b) it makes resolve queries more predictable in terms of how long they take
c) as I will describe below, if parallelized, the additional time needed during start would nearly equal the time needed to open the slowest pool (in my case the IDUnion Test, but several pools have a similar time). So the call to one of these slow pools would need nearly as much extra time for opening the pool as we would need to open all pools during the start of the driver.

In a first step, I am trying to reduce the runtime for IndyConnector.openIndyConnections() .

I checked the runtimes for the different for loops in IndyConnector.openIndyConnections() and found that (unsurprisingly) the last for-loop which is actually creating the connections takes 99% of the runtime.

I used parallelStream to parallelize that for-loop and just collected the exceptions into a list to throw them after all networks attempted to open the connection.
I found that this reduces the runtime from 2-3 minutes to 20-40 seconds, which is basically the runtime of opening the slowest pools when done sequentially.
I opened a Pull Request with the changes. I am not sure whether some further improvement is possible but it would probably need to come from the IndyConnection.openPool() function. But I think 20-40 seconds is accetable during the start of the drivers, especially compared to 2-3 minutes during the first request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.