Why is Bloomberg API working slower when adding "blpapi3.jar" as a dynamic library instead of static library?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 8 Mag 2019
Commentato: Rena Berman
il 9 Mag 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?
Risposta accettata
MathWorks Support Team
il 9 Mag 2022
Modificato: MathWorks Support Team
il 9 Mag 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 Commento
Più risposte (0)
Vedere anche
Categorie
Scopri di più su MATLAB Report Generator in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!