Performance issue Artist view vs. Album view

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Xycl Offline
Senior Member
Posts: 248
Joined: Feb 2012
Reputation: 6
Location: Germany
Post: #1
I mainly use XBMC as a music player. My library contains 1800 albums and 1200 artists (with albums)

My main living room HTPC contains an AMD Zacate e350 CPU.

Selecting the 1800 albums takes 1 sec. Selecting the 1200 artists takes 3 secs. (everything rounded up or down)
That means that the library artist view is 4.5 times slower than the album view!

Therefore I played with method CMusicDatabase::GetArtistsNav() in order to make it quicker.
My solution is to change the loop in which the data is fetched:
Code:
// get data from returned rows
    while (!m_pDS->eof())
    {
      CStdString strArtist = m_pDS->fv("strArtist").get_asString();
      CFileItemPtr pItem(new CFileItem(strArtist));
      pItem->GetMusicInfoTag()->SetArtist(strArtist);
      CStdString strDir;
      int idArtist = m_pDS->fv("idArtist").get_asInt();
      strDir.Format("%ld/", idArtist);
      pItem->SetPath(strBaseDir + strDir);
      pItem->m_bIsFolder=true;
      pItem->GetMusicInfoTag()->SetDatabaseId(idArtist);
      if (CFile::Exists(pItem->GetCachedArtistThumb()))
          pItem->SetThumbnailImage(pItem->GetCachedArtistThumb());
      pItem->SetIconImage("DefaultArtist.png");
/*  
      CArtist artist;
      GetArtistInfo(idArtist,artist,false);
      SetPropertiesFromArtist(*pItem,artist);
*/
      items.Add(pItem);

      m_pDS->next();
    }

Problem: I don't know the reason for the GetArtistInfo() call. Everything "seems" to work. Even the Info key gives me the artist info.

Am I wrong or is this a possible performance optimization?

Main page: https://github.com/Xycl
Repository: Xycl Repository
How to submit a log file: XBMC-Wiki
(This post was last modified: 2012-08-07 17:37 by Xycl.)
find quote
Montellese Offline
Team-XBMC Developer
Posts: 2,790
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #2
(2012-08-07 17:35)Xycl Wrote:  I mainly use XBMC as a music player. My library contains 1800 albums and 1200 artists (with albums)

My main living room HTPC contains an AMD Zacate e350 CPU.

Selecting the 1800 albums takes 1 sec. Selecting the 1200 artists takes 3 secs. (everything rounded up or down)
That means that the library artist view is 4.5 times slower than the album view!

Therefore I played with method CMusicDatabase::GetArtistsNav() in order to make it quicker.
My solution is to change the loop in which the data is fetched:
Code:
// get data from returned rows
    while (!m_pDS->eof())
    {
      CStdString strArtist = m_pDS->fv("strArtist").get_asString();
      CFileItemPtr pItem(new CFileItem(strArtist));
      pItem->GetMusicInfoTag()->SetArtist(strArtist);
      CStdString strDir;
      int idArtist = m_pDS->fv("idArtist").get_asInt();
      strDir.Format("%ld/", idArtist);
      pItem->SetPath(strBaseDir + strDir);
      pItem->m_bIsFolder=true;
      pItem->GetMusicInfoTag()->SetDatabaseId(idArtist);
      if (CFile::Exists(pItem->GetCachedArtistThumb()))
          pItem->SetThumbnailImage(pItem->GetCachedArtistThumb());
      pItem->SetIconImage("DefaultArtist.png");
/*  
      CArtist artist;
      GetArtistInfo(idArtist,artist,false);
      SetPropertiesFromArtist(*pItem,artist);
*/
      items.Add(pItem);

      m_pDS->next();
    }

Problem: I don't know the reason for the GetArtistInfo() call. Everything "seems" to work. Even the Info key gives me the artist info.

Am I wrong or is this a possible performance optimization?

Guessing from the code it looks to me like you are not working with latest master. There have been some improvements in the music database and also in retrieving the list of artists. The GetArtistInfo() call isn't there anymore.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
Xycl Offline
Senior Member
Posts: 248
Joined: Feb 2012
Reputation: 6
Location: Germany
Post: #3
Okay my fault. It's the Eden source code.
Next weekend when I'm at home I'll try the latest nightly build on the Zacate machine.
Now I can only access my development laptop. But with a Core i7 it doesn't make sense to discuss 0.5 secs. vs. 0.8 secs.

Main page: https://github.com/Xycl
Repository: Xycl Repository
How to submit a log file: XBMC-Wiki
find quote