Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Slow performance with Hyper-Threading or Dual Core Systems
Started by tcsuk01 at 07-11-2008 5:48. Topic has 5 replies.

Print Search « Previous Thread Next Thread »
  07-11-2008, 5:48
tcsuk01 is not online. Last active: 9/26/2008 5:35:07 PM tcsuk01

Not Ranked
Joined on 06-05-2008
Posts 4
Slow performance with Hyper-Threading or Dual Core Systems
Reply Quote

I have compiled a small application to concatenate two mpeg files using the sample code supplied with the tools. I have added a sub routine to measure how many samples per second the application is processing.

On a recently purchased Dual Core PC I only get 64 samples a second and it takes over an hour to copy the samples from the first file to the destination file.

On a Hyper Threading Pentium 4 PC purchased two years ago I get the same result.

On a standard Pentium 4 PC purchased 3-4 years ago I get about 800-900 samples a second! I also get roughly the same high speed result on my old Celeron powered laptop which is an aging 4-5 years old...[:|]

However when I disable Hyper-Threading option on my HT P4 it speeds up the result to the same as the old Pentium 4 PC. This leads me to believe the performance issue is related to the processor characteristics.

On all machines I am running Windows XP. I have tried running the app with SP1, SP2 or SP3 updates installed but that does not change the result on either machine. I am using Multimedia Library 15.1 that I recently purchased.

Eternally greatfull for any advice.

Thanks

Matt


   Report 
  07-13-2008, 11:54
Adam Boulad is not online. Last active: 11/20/2008 3:23:08 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 513
Re: Slow performance with Hyper-Threading or Dual Core Systems
Reply Quote

Matt,
I need to be able to reproduce this issue at my side.
If you use our concatenate demo and try to use it on machines with different processors (HT, Dual Core, etc.), which result will be faster? Try to use two files that are 50MB or larger.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  07-14-2008, 5:59
tcsuk01 is not online. Last active: 9/26/2008 5:35:07 PM tcsuk01

Not Ranked
Joined on 06-05-2008
Posts 4
Re: Slow performance with Hyper-Threading or Dual Core Systems
Reply Quote

On both HT and Dual core I average just 64 samples a second - they are virtually identical. When I switched off the HT option in the BIOS I got 800 -900 samples. Both mpegs are around 600 -700 MB.

Over the weekend I have created a new vb.net console that simply reads all the samples from the the source file and recompiles them to the destination file. I still get the same sample rates. I have stipped out everything I believe is not vital:

Imports LTMMLib

Module Module1

Sub Main()

Dim xcca, xccb As ltmmConvertCtrl

Dim xtarget As ltmmMultiStreamTarget

Dim xsource As ltmmMultiStreamSource

Dim xmt As New ltmmMediaType

Dim xsamples, a, xstream As Long

Dim xsrc, xdst As New ltmmMediaSample

Dim xsps, xtimer As Long

On Error GoTo quit

xcca = New ltmmConvertCtrl

xcca.sourcefile = "c:\join_test\source.mpg"

xtarget = New ltmmMultiStreamTarget

xtarget.StreamCount = 2

xmt = New ltmmMediaType

xmt.Type = ltmmConstants.ltmmMEDIATYPE_Video

xtarget.SetAcceptedMediaType(0, xmt)

xmt.ResetMediaType()

xmt.Type = ltmmConstants.ltmmMEDIATYPE_Audio

xtarget.SetAcceptedMediaType(1, xmt)

xcca.TargetObject = xtarget

xcca.StartConvert()

xccb = New ltmmConvertCtrl

xsource = New ltmmMultiStreamSource

xsource.StreamCount = 2

xsource.SetMediaType(0, xtarget.GetConnectedMediaType(0))

xsource.SetMediaType(1, xtarget.GetConnectedMediaType(1))

xccb.TargetFile = "c:\join_test\dest.mpg"

xccb.TargetFormat = ltmmConvert_TargetFormat.ltmmConvert_TargetFormat_MPEG2_PROGRAM

xccb.SourceObject = xsource

xccb.StartConvert()

xtimer = Microsoft.VisualBasic.DateAndTime.Timer

xsps = 0

Do

xsamples = xsamples + 1

Console.SetCursorPosition(0, 0)

Console.Write("Samples " & xsamples)

xstream = xtarget.WaitForSample(10000)

xsrc = New ltmmMediaSample

xsrc = xtarget.GetSample(xstream, 10000)

xdst = New ltmmMediaSample

xdst = xsource.GetSampleBuffer(xstream, 10000)

xdst.SetData(xsrc.ActualDataLength, xsrc.GetData(xsrc.ActualDataLength))

xdst.Discontinuity = xsrc.Discontinuity

xdst.Preroll = xsrc.Preroll

xdst.SyncPoint = xsrc.SyncPoint

System.Runtime.InteropServices.Marshal.ReleaseComObject(xsrc)

xsource.DeliverSample(xstream, 10000, xdst)

System.Runtime.InteropServices.Marshal.ReleaseComObject(xdst)

If Microsoft.VisualBasic.DateAndTime.Timer >= xtimer + 1 Then

Console.SetCursorPosition(0, 5)

Console.Write("Samples per second: " & xsamples - xsps)

xsps = xsamples

xtimer = Microsoft.VisualBasic.DateAndTime.Timer

End If

Loop

quit:

If Err.Number <> 0 Then

MsgBox(Err.Description & " " & Err.Number & " Line: " & Err.Erl)

End If

End Sub

End Module

 

 


   Report 
  07-15-2008, 12:36
Adam Boulad is not online. Last active: 11/20/2008 3:23:08 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 513
Re: Slow performance with Hyper-Threading or Dual Core Systems

Attachment: Attachment.zip
Reply Quote
Matt,
I'm not sure how you are calculating the samples/second, but I don't think that it is and accurate measurement. I have tried on my 'Core 2 Duo' processor machine to open three instances of the same EXE (based on your code), and as you can see in the attachment, one had low samples/second and the others had a large samples/second. But they all finished in 22 second.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  07-16-2008, 13:45
tcsuk01 is not online. Last active: 9/26/2008 5:35:07 PM tcsuk01

Not Ranked
Joined on 06-05-2008
Posts 4
Re: Slow performance with Hyper-Threading or Dual Core Systems
Reply Quote

I agree the timer is not always precise, but on large files it is pretty accurate.

However, on the Celeron laptop it states 800-900 samples and I can visually see that the counter is incrementing in that fashion.

The Dual core machine always states 64 (coincidently the same as you got on the second console in your screen capture?) and the counter does look to be incrementing just that.

I added a start and end time stamp to the script at the start and end of the sub.

        Console.SetCursorPosition(0, 7)
        Console.Write("Start Time: " & Microsoft.VisualBasic.TimeOfDay)

       ...

        Console.SetCursorPosition(0, 8)
        Console.Write("End Time: " & Microsoft.VisualBasic.TimeOfDay)

 I then set the source file to the demo mpeg "DaDa_DVD_MPEG2.mpg". On the Dual Core, it stated a four second diffence between the start and end time. On the Celeron, it stated no seconds difference.

I am dealing with i-frame only Mpegs that range from 700Mb to several Gbs. At a rate of 64 samples a seconds it would take hours to complete the task compared to under an hour on my Celeron…

What results do you get?

 

 


   Report 
  07-17-2008, 10:15
Adam Boulad is not online. Last active: 11/20/2008 3:23:08 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 513
Re: Slow performance with Hyper-Threading or Dual Core Systems
Reply Quote
Matt,
I’m still not sure about the samples/second variable. However, I tried to calculate the overall time needed for the conversion process. I have tried a file with 42833 Samples.
Here are the results of my testing:

Two instances of the application on a 1.8 GHz Core 2 Duo processor.
Instance 1- Samples per second: 58
Duration: 10:50 min.
Instance 2- Samples per second: 582 (which was an average)
Duration: 11:03 min.

I also tried 1 instance of the application on a 2.8 GHz HT Processor:
With HT on:
Duration: 11:15 min.
With HT off:
Duration: 10:55 min.

As you can see, these results do not show the problem.
Adam Boulad
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » Multimedia » Slow performance with Hyper-Threading or Dual Core Systems

Powered by Community Server, by Telligent Systems