vendredi 13 février 2015

Java Sound dramatically slower after JVM 8 update

My Application loads a bunch of audio clips at startup. It uses java.applet.Applet.newAudioClip(URL audioFileURL) to load the files, which are in the same folder. I could see that this function is basically a wrapper to get JavaSoundAudioClip objects


Until yesterday, I compiled the JAR with JDK 7 and launched it with JVM version 7 update 45. Then I updated the JVM to version 8 update 31.

Now, the loading of each audio takes ten times longer than before (was 0.2 seconds each, now it is between 2 and 3 seconds)


Digging deeper in debugging, I found that the methods that slowed down the most are AudioSystem.getAudioInputStream , AudioSystem.isLineSupported , AudioSystem.getLine


Audio format shouldn't be involved: I tried both OGG and WAV with the same results.


The settings for both JVMs are the same


Aucun commentaire:

Enregistrer un commentaire