Win7-64bit : performance of "new bitmap(filename)"?

  • Thread starter Thread starter JesperSP
  • Start date Start date
J

JesperSP

Guest
Dear all,

I have written a Forms application that analyzes a lot of (~1400) 8-bit jpg images from automated lab-equipment. I am in the process of migrating from WinXP to Win7 and to my surprise I noticed that analysis was 5 times slower under win7 compared to win XP (!?!?!). I investigated further and found that the loading of the jpg images was the step that was takning longer! The simple code demonstrates the problem: On XP i get 70 images per second, but only 12 images per second under win7. Has anyone else noticed this performance drop, and can something be done to improve it?

In my project I have spent a lot of time on optimizations and multithreading, and on XP the software can process images at 160 frames per second (on Intel(R) Core(TM) I5 M540). But my effort seems wasted if all I can get is 12 fps per core/thread on win7 :(

Cheers,
JesperSP



Public Class Form1


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim starttime As DateTime = Now
Dim counter As Integer = 0
For Each filename As String In My.Computer.FileSystem.GetFiles(FolderBrowserDialog1.SelectedPath)
If filename.EndsWith(".jpg") Then
Dim bm As New Bitmap(filename, False)
' do something with bitmap
' PictureBox1.Image = bm
bm.Dispose()
counter += 1
Dim seconds As Double = (Now - starttime).TotalSeconds
If seconds > 0 Then Label1.Text = counter / seconds & " images per second."
Application.DoEvents()
End If
Next


End If
End Sub
End Class


Continue reading...
 
Back
Top