bytedeco/javacv

Loading of libraries slower after update to 1.5.10 (Windows, no longer cached?)

Open

#2,179 opened on Jan 29, 2024

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
bughelp wanted

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

First off thanks for all your great work. I just updated to 1.5.10 and noticed loading of libraries went from 500ms to 5 seconds in my project, I did a little bit of debugging and I get the impression it has to do with caching, with 1.5.9 I see the following debug messages when I start my app for the first time after deleting the cache (I am creating a FFmpegFrameGrabber here):

Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.javacpp.Loader
Debug: Locking C:\Users\remco\.javacpp\cache before extracting
Debug: Extracting jar:file:/C:/Users/remco/.m2/repository/org/bytedeco/javacpp/1.5.9/javacpp-1.5.9-windows-x86_64.jar!/org/bytedeco/javacpp/windows-x86_64/api-ms-win-crt-locale-l1-1-0.dll
Debug: Loading C:\Users\remco\.javacpp\cache\javacpp-1.5.9-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\api-ms-win-crt-locale-l1-1-0.dll
Debug: Locking C:\Users\remco\.javacpp\cache before extracting
Debug: Extracting jar:file:/C:/Users/remco/.m2/repository/org/bytedeco/javacpp/1.5.9/javacpp-1.5.9-windows-x86_64.jar!/org/bytedeco/javacpp/windows-x86_64/api-ms-win-crt-string-l1-1-0.dll
Debug: Loading C:\Users\remco\.javacpp\cache\javacpp-1.5.9-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\api-ms-win-crt-string-l1-1-0.dll
Debug: Locking C:\Users\remco\.javacpp\cache before extracting
Debug: Extracting jar:file:/C:/Users/remco/.m2/repository/org/bytedeco/javacpp/1.5.9/javacpp-1.5.9-windows-x86_64.jar!/org/bytedeco/javacpp/windows-x86_64/api-ms-win-crt-stdio-l1-1-0.dll
Debug: Loading C:\Users\remco\.javacpp\cache\javacpp-1.5.9-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\api-ms-win-crt-stdio-l1-1-0.dll
Debug: Locking C:\Users\remco\.javacpp\cache before extracting
Debug: Extracting jar:file:/C:/Users/remco/.m2/repository/org/bytedeco/javacpp/1.5.9/javacpp-1.5.9-windows-x86_64.jar!/org/bytedeco/javacpp/windows-x86_64/api-ms-win-crt-math-l1-1-0.dll
Debug: Loading C:\Users\remco\.javacpp\cache\javacpp-1.5.9-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\api-ms-win-crt-math-l1-1-0.dll

...

And with 1.5.10 I see this when running after deleting the cache:

Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading library api-ms-win-crt-locale-l1-1-0
Debug: Loading library api-ms-win-crt-string-l1-1-0
Debug: Loading library api-ms-win-crt-stdio-l1-1-0
Debug: Loading library api-ms-win-crt-math-l1-1-0
Debug: Loading library api-ms-win-crt-heap-l1-1-0
Debug: Loading library api-ms-win-crt-runtime-l1-1-0
Debug: Loading library api-ms-win-crt-convert-l1-1-0
...

So it looks like libraries are no longer extracted to the cache. I will try to make some time to look into this deeper but if you have any suggestions that would be greatly appreciated, could it perhaps be that I have to configure caching myself with the new version?

Contributor guide