[SOLVED] Improve the Media Library speed

General discussion about Universal Media Server (no support or requests)
Post Reply
User avatar
Sami32
Posts: 851
Joined: Mon Apr 11, 2016 5:09 am

[SOLVED] Improve the Media Library speed

Post by Sami32 »

I was reading that http://java-performance.info/base64-enc ... rformance/ while trying to diagnotic an issue.

Since we can see that Java 8 native Base64 implementation is very fast, so will be the embedded CoverArt/AlbumArt (ID3 Tag) process before include them into the database if we use it.

Maybe you did it already, or it is too complicated to maintain a Java 8 version different from Java 7 ?
Just an idea :roll:
Last edited by Sami32 on Wed Jul 13, 2016 1:56 am, edited 5 times in total.
User avatar
Sami32
Posts: 851
Joined: Mon Apr 11, 2016 5:09 am

Re: Make the Media Library faster with Java 8

Post by Sami32 »

No.
Just asking if

Code: Select all

java.util.Base64
class was used in Java 8 version, and if it will sound reasonnable to implement it for a faster Media Library (when it contain many Cover Art/Album Art ID3 Tags), since for now i saw that Apache Commons-Codec was used :

Code: Select all

import org.apache.commons.codec.binary.Base64;
Name | Decode, 200000000 bytes
JavaXmlImpl | 0.885 sec
Java8Impl | 0.887 sec
MiGBase64Impl | 1.928 sec
IHarderImpl | 2.431 sec
ApacheImpl | 2.552 sec
GuavaImpl | 3.744 sec
SunImpl | 4.096 sec
So, if we believe this comparison test from 2014, we can make it around 3 times faster.

P.S. Sorry for not being clear in my first post.
Last edited by Sami32 on Sat Jul 09, 2016 10:33 pm, edited 2 times in total.
User avatar
SubJunk
Lead Developer
Posts: 3705
Joined: Sun May 27, 2012 4:12 pm

Re: Improve the Media Library speed ?

Post by SubJunk »

It's worth looking into, thanks for pointing it out :)
erick diangilis
Posts: 161
Joined: Sun May 22, 2016 8:25 am

Re: Improve the Media Library speed ?

Post by erick diangilis »

hi guys how are you doing? i know its my question has different subject in matter but since you understand more about programming java and things like this i found this java 9 update 125 early acess on the oracle website i would like to try but the even the lastest ums 6.4.1 snapshot that i've got doesn't work with it is there a possibility in a future version to have a compatibility or its too early to use because its not officialy released yet and its not in its full form to make a ums compatible with java 9? ;)



thanks for the atention and have a good day ;)
User avatar
valib
Developer
Posts: 699
Joined: Fri Feb 08, 2013 3:11 am

Re: Improve the Media Library speed ?

Post by valib »

Sami32 do you mean somethink like this?

Code: Select all

...
import java.util.Base64;
...

...
value = MI.Get(general, 0, "Cover_Data");
				if (!value.isEmpty()) {
					media.setThumb(Base64.getDecoder().decode(value));
				}
...
User avatar
Sami32
Posts: 851
Joined: Mon Apr 11, 2016 5:09 am

Re: Improve the Media Library speed ?

Post by Sami32 »

Valib Yes, exactly what i was thinking about, your skill make it easy ;-)
I am better for looking at, trying to understand, that coding it :lol:

P.S. Thanks to Valib for this implementation 8-)
Post Reply