Why is Bloomberg API working slower when adding "blpapi3.jar" as a dynamic library instead of static library?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 8 Mai 2019
Commenté : Rena Berman
le 9 Mai 2022
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?
Réponse acceptée
MathWorks Support Team
le 9 Mai 2022
Modifié(e) : MathWorks Support Team
le 9 Mai 2022
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.
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Bloomberg Desktop dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!