[vorbis] Performance tests

Erik Olofsson erik at o3games.com
Wed Oct 17 06:58:52 PDT 2001



Beeing on Windows I was not able to perform this test. So I coded a program
that measures the time it takes to loop 160 000 000 times and compare it to
a calibration run. This seems to work very well. 

Winamp 2.77 on p166 MMX:
MP3 128 kbit: 20 % util with dsound, 16 % util with NULL output
OGG 138 kbit: 27 % util with dsound, 21 % util with NULL output
OGG 66 kbit: 26 % util with dsound, 20 % util with NULL output

Winamp 2.77 on dual p3 800:
OGG 138 kbit: 2.5 % util with dsound or 5 % for one processor
OGG 138 kbit: 2.2 % util with null or 4.5 % for one processor
MP3 128 kbit: 1.5% with dsound or 3 % for one processor
MP3 128 kbit: 1% with null or 2 % for one processor

The p3 800 has so low util that It may very well be a high error. I run two
instances of my program to measure on a dual system

Here is the relevant code:

#pragma optimize( "", off)

void CCpuUsageDlg::OnCalibrare() 
{
        SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);

        // Let Priority kick in
        for (__int64 i = 0; i < 160000000; ++i)
        {
        }
                
        LARGE_INTEGER CpuUsage;
        LARGE_INTEGER CpuSpeed;
        LARGE_INTEGER CpuStart;
        QueryPerformanceFrequency(&CpuSpeed);
        QueryPerformanceCounter(&CpuUsage);

        __int64 CpuEnd = CpuUsage.QuadPart + CpuSpeed.QuadPart * 10;

        QueryPerformanceCounter(&CpuStart);

        for (i = 0; i < 160000000; ++i)
        {
        }

        QueryPerformanceCounter(&CpuUsage);

        Iterspersec = __int64 ((double)i / (((double)CpuUsage.QuadPart -
(double)CpuStart.QuadPart)/(double)CpuSpeed.QuadPart));

        CString Str;
        Str.Format("%i64 iterspersec", Iterspersec);

        m_Text.SetWindowText(Str);

        SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
        
}

void CCpuUsageDlg::OnMeasure() 
{
        LARGE_INTEGER CpuUsage;
        LARGE_INTEGER CpuSpeed;
        LARGE_INTEGER CpuStart;
        while (1)
        {
                QueryPerformanceFrequency(&CpuSpeed);
                QueryPerformanceCounter(&CpuUsage);
                
                __int64 CpuEnd = CpuUsage.QuadPart + CpuSpeed.QuadPart * 10;
                
                QueryPerformanceCounter(&CpuStart);
                
                for (__int64 i = 0; i < 160000000; ++i)
                {
                }
                
                QueryPerformanceCounter(&CpuUsage);
                
                __int64 Iterspersec2 = __int64 ((double)i /
(((double)CpuUsage.QuadPart -
(double)CpuStart.QuadPart)/(double)CpuSpeed.QuadPart));
                
                CString Str;
                Str.Format("%f cpu usage",  (float)(100.0 -
((double)Iterspersec2 / (double)Iterspersec * 100.0)));
                
                m_Text.SetWindowText(Str);
                m_Text.UpdateWindow();
                
        }
        
        
}
#pragma optimize( "", on)

-----Original Message-----
From: Kenneth Arnold [mailto:ken at arnoldnet.net] 
Sent: den 17 oktober 2001 03:36
To: vorbis at xiph.org
Subject: Re: [vorbis] Performance tests

On Tue, Oct 16, 2001 at 09:17:03PM -0400, safemode wrote:
> On Tuesday 16 October 2001 20:50, Jack Moffitt wrote:
> > This is slightly wrong.  decoder_example is slow.  vorbisfile_example is
> > much faster, because of the inline asm that does float->int conversion.
> >
> > use vorbisfile_example, since that's also what most players use.
> >
> > jack.
> 
> Why bother comparing to mp3 decoding?   Why not just compare against ogg 
> decoding and try to keep lowering the number?  Does ogg vorbis need mp3 to

> prove something?  I dont think it should.  mp3 should not be a factor in
any 
> ogg testing except audio output.    mp3 decoders dont use one libmp3 like
all 
> ogg decoders use libogg.  and mpg123 is far from the fastest.  It's best
just 
> to stay away from mp3 comparisons.  

Agreed for both your and Jack's comments. I had forgotten that
decoder_example was different, having not used any of the example code
in nearly a year. Repeating my earlier test, vorbisfile_example gives
7.440 seconds for the same file.

People seemed to want to compare Vorbis to MP3. According to others,
and my understanding pretty much agrees, Vorbis is about as
computationally complex as MP3, so it should be theoretically as fast
as MP3 for decoding. That's ignoring the hand-tuned assembly that has
gone into many MP3 decoders and not Vorbis, so I find the present
numbers fairly impressive. I think those interested in comparisons
should wait until the codec is finalized and speed tuning really
becomes an issue (i.e. right before 1.0) and try these same tests
again then.


-- 
Kenneth Arnold <ken at arnoldnet.net>
- "Know thyself."

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis mailing list