Why is Bloomberg API working slower when adding "blpapi3.jar" as a dynamic library instead of static library?

3 次查看(过去 30 天)
I am using the Datafeed Toolbox and I am executing "blp/history" function and requesting a lot of data.
When I use "blp/history" with a dynamic path, it may take hours to complete running. However, with a static path, it is much faster and it can be done in about 20 minutes or so.
Why does "blp/history" perform so much slower when I use the dynamic path rather than the static path?

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2022-5-9
The function "blp/history" has two possible code paths depending on how "blpapi3.jar" is added to the classpath.
If "blpapi3.jar" is added:
- statically, then MATLAB is able to use code in "datafeed.jar" that parses the event messages at the Java level and then passes a Java vector back to MATLAB. There is only one MATLAB/Java boundary crossing in this case and it is much faster.
- dynamically, then MATLAB is not able to resolve what it needs at a startup making the code in "datafeed.jar", that relies on "blpapi3.jar", inaccessible. In this case, "blp/history" falls back to using the MATLAB code path, which makes the Java calls directly from the MATLAB Workspace and there are many MATLAB/Java boundary crossings needed to parse the event messages. Thus, this implementation is much slower.
Add "blpapi.jar" to the static Java path rather than the dynamic path. That is, define a "javaclasspath.txt" rather than using "javaaddpath" - this will give you the best performance. See the section "Add Jar File Classes" in the MATLAB documentation page about the static Java classpath:
Additionally, if Bloomberg API is still slow after adding it to the static path, try downloading the 'blpapi3.jar' from Bloomberg again and replace it in your current installation.

    更多回答(0 个)

    类别

    Help CenterFile Exchange 中查找有关 Bloomberg Desktop 的更多信息

    产品


    版本

    R2019a

    Community Treasure Hunt

    Find the treasures in MATLAB Central and discover how the community can help you!

    Start Hunting!

    Translated by