![]() |
2009-03-07
, 08:32
|
Posts: 1,418 |
Thanked: 1,541 times |
Joined on Feb 2008
|
#172
|
The Following User Says Thank You to fms For This Useful Post: | ||
![]() |
2009-03-07
, 18:00
|
|
Posts: 3,404 |
Thanked: 4,474 times |
Joined on Oct 2005
@ Germany
|
#173
|
Mplayer connection has become even more unstable (mplayer hangs sometimes, also starts showing video when MediaBox is in the browser mode). Startup time has gone way up since the last version. Also (just like the last version), there are quite noticeable (several seconds) delays when you click on some interface buttons. Not using swap.
![]() |
2009-03-07
, 18:46
|
Posts: 1,418 |
Thanked: 1,541 times |
Joined on Feb 2008
|
#174
|
This sounds really bad. Are there other applications running at the same time that consume CPU?
How long is your startup time for MediaBox?
Delays of several seconds in the interface sounds like something is going really wrong.
![]() |
2009-03-07
, 20:48
|
|
Posts: 3,404 |
Thanked: 4,474 times |
Joined on Oct 2005
@ Germany
|
#175
|
Not really. There is FBReader running, but it is not doing anything at the moment.
There are two kinds of delays:
1. When MediaBox transitions between screens (like when showing a video or showing a list of items) there is a 2-5 second delay with 100% CPU load, most likely due to actual processing in Python (have you considered changing to C/C++?)
2. When I scroll through a list, MediaBox sometimes hangs up for 0.5-2 seconds, maybe due to Python garbage collection.
![]() |
2009-03-07
, 21:06
|
Posts: 1,418 |
Thanked: 1,541 times |
Joined on Feb 2008
|
#176
|
MediaBox 0.96.4 with all plugins installed: 29.8s. Your startup time doesn't look too bad and I don't think I saw it any better with 0.96.3. But there's still room for improvement.
The transition between video and list of items seems to be taking longest time. I'm going to put more focus on this. But I don't think that changing to C/C++ would bring much performance gain. The bottleneck is rendering and that's GDK and thus on C level already. The key is to minimize the amount of rendering.
While scrolling through a list, the thumbnails are loaded from file when needed. Maybe a slow memory card causes this delay. But even on my 770 I don't get a delay of 2 seconds.
![]() |
2009-03-08
, 13:26
|
|
Posts: 3,404 |
Thanked: 4,474 times |
Joined on Oct 2005
@ Germany
|
#177
|
So, if there is anything that can slash the loading time, apply it by all means
Once the scrollable list shows up, it looks to be filling up asynchronously. Only small part of the list (5-7 items) is shown at any moment of time. So, what part of rendering contributes to that delay?
I doubt that scrolling delays are directly caused by the thumbnail rendering (they may though, and then it is all up to the filesystem responsiveness). Instead, they may be caused by garbage collection or some other internal process in Python. If it is true, then it would be fixable by preallocating all memory for the list before scrolling it.
self.render_icon
render_label
render_bg
![]() |
2009-03-08
, 15:01
|
|
Posts: 259 |
Thanked: 59 times |
Joined on Feb 2008
|
#178
|
![]() |
2009-03-08
, 16:12
|
Posts: 1,418 |
Thanked: 1,541 times |
Joined on Feb 2008
|
#179
|
The Following User Says Thank You to fms For This Useful Post: | ||
![]() |
2009-03-08
, 16:17
|
Posts: 1,418 |
Thanked: 1,541 times |
Joined on Feb 2008
|
#180
|
I think I'm making some good progress there.
The next release should startup faster. But 7 seconds on the N8x0? Not even microB achieves this (just measured; 9 seconds).
As weird as it sounds, it's a full screen rendering because of changing the layout and the toolbar contents. I'm now trying to minimize the amount of rendering a bit further. Especially the toolbar stuff should be optimizable.
The screens contents are moved by the amount that you scroll (Xserver-side pixmap copying). Only the newly visible items get rendered. Every time a new item with a thumbnail gets rendered, the thumbnail has to be read from file. There is some thumbnail and item caching involved, too, for speeding up the process, but these caches can't hold many items.
Text rendering can take some time when pango has to lookup new characters (e.g. for displaying CJK characters), but once the characters are loaded the delay won't happen again.
It would be interesting to see what happens when you disable thumbnail loading and rendering by opening /usr/lib/mediabox/components/media_viewer/MediaItem.py and commenting out the line with
For albums, MediaBox looks for an image file in the same folder as the file (not necessarily folder.jpg) and takes this. Alternatively it's also possible to embed the cover art in the ID 3 tags of the files.