The first improvement in xine with Mercurial

So, after xine finally moved to Mercurial for xine-lib management, I’ve decided to start working on those things that required me to branch out, at least on some of them that is; the first one I was able to tackle down was ffmpeg_integration, that now works fine beside the dist target.

And then I moved working on the structures, applying pahole to all the structures in libxine, even those comprising the public ABI of the library, as I could just break the ABI when needed, rather than limiting to the local structures of the plugins. Some of these changes applied to structures that are not part of the public ABI, so I ended up merging them to the main repository already, and will be present in 1.1.5, even if they are mostly bytes-size changes, that nobody beside me should care about.

But then tonight I gone looking for the 32 buttons that are/were present as an inline array in one of the video overlay structures; I was going to change the inline array with a dynamic array or with an array of pointers, so that the memory was going to be used only when actually used..

It was a sour surprise to find out that the array was never used at all in the code, and it wasn’t used on frontends either, and by removing it, the size of the structure in which it was dropped from 86KB to 40 bytes.. and then the video_overlay_s structure dropped from over 4MB to about 3KB… finally with it removed, there was also a 10MB of memory usage cut down during xine-lib runtime playback, 1/3 of the memory usage when playing an mp3 file:

(before the change, about 1.1.4 release)



(after the change, on my nopadding branch)




For starters, this does seem quite good, don’t you think? :)

Trackbacks

Use the following link to trackback from your own site:
http://blog.flameeyes.eu/trackbacks?article_id=3916

Comments

Leave a reply →

 
Avatar
dirtyepic
about 2 hours later:
 

holy crap.

nice work.

Avatar
yoshi314
about 11 hours later:
 

nice.

but the ‘diminishing returns’ rule will kick in sooner or later.

Avatar
Torangan
about 11 hours later:
 

Sounds very nice. But can you point out some documentation about pahole? I tried to run it on Wesnoth and it couldn’t identify quite some code and I couldn’t understand all of its output or find information. I found huge holes before the first data member probably due to inheritance the most depressing.

Avatar
Flameeyes
about 15 hours later:
 

Torangan, I’m not really sure if there is any real documentation about pahole itself.
I think the best link I can give you about that is Arnaldo’s blog where he wrote about pahole quite a few times.

Leave a comment

Name (required)
 
Email (gravatar enabled) (never displayed)
 
Website