Results 1 to 15 of 15

Thread: Windows 7 - Windows 10 conversion - Slow running

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    314

    Windows 7 - Windows 10 conversion - Slow running

    I have currently transferred form windows 7 to windows 10 (clean installation) with VS2010. I have a very complex programme that is now running considerably slower under windows 10. all the config settings and everything else is identical

    Is this a recognized issue with widows 10 or is there something that needs amending for running under windows 10 ?

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,753

    Re: Windows 7 - Windows 10 conversion - Slow running

    I always found VS2010 to be sluggish in performance. You could download the free version of VS2019

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    314

    Re: Windows 7 - Windows 10 conversion - Slow running

    Both versions of windows are running Visual studio 2010, so would you still expect a large difference in performance ?

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,753

    Re: Windows 7 - Windows 10 conversion - Slow running

    I have a paid for version of VS2010, which i never use. On my win10 workstation, i have VS2008, VS2012, VS2015, VS2017, VS2019, all of which run ok. But VS2008 loads fastest

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,339

    Re: Windows 7 - Windows 10 conversion - Slow running

    I think .paul. thinks you're talking about VS 2010 itself running slowly. You're actually talking about your own application built with VS 2010, right? If so then no, there's nothing that makes VB applications run slower on Windows 10 for no reason.

  6. #6
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,753

    Re: Windows 7 - Windows 10 conversion - Slow running

    Quote Originally Posted by jmcilhinney View Post
    I think .paul. thinks you're talking about VS 2010 itself running slowly. You're actually talking about your own application built with VS 2010, right? If so then no, there's nothing that makes VB applications run slower on Windows 10 for no reason.
    Yeah that was my point...

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    314

    Re: Windows 7 - Windows 10 conversion - Slow running

    Ok, I have carried out a test with the following (very simple code)

    Code:
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            
            Dim Stopwatch As New Stopwatch()
            Dim i As Integer
            Stopwatch.Start()
    
            Me.TextBox2.Text = TimeOfDay
            For i = 1 To 1000000
                Me.TextBox1.Text = i
            Next
            Me.TextBox3.Text = TimeOfDay
    
        End Sub
    Running the Same code under Windows 7 & Windows 10 gives the following results :

    Windows 7 - completes in 25 seconds
    Windows 10 -completes in 71 Seconds

    So it is taking 3 times as long to run the same program in windows 10, than windows 7 both using VS2010 ???
    Last edited by Signalman; Jan 16th, 2021 at 12:01 PM.

  8. #8
    Addicted Member
    Join Date
    Jun 2019
    Posts
    247

    Re: Windows 7 - Windows 10 conversion - Slow running

    Win7 - 15 - 16 seconds (5 runs)
    Win10 - from 22 seconds to 73 seconds (5 runs)
    VS2019, project targets .NET 4.8

    Everything runs on same hardware.

  9. #9
    Addicted Member
    Join Date
    Jun 2019
    Posts
    247

    Re: Windows 7 - Windows 10 conversion - Slow running

    I've seen something similar with .NET Core - running same project on Win 10, Win 7 and Linux results are so different so I gave up. The app was console one for obvious reasons, so there is no relation to WinForms and UI.

    Another example with difference of execution time for same procedure is part I copied for testing from .NET runtime source. Calling original library function works for less than a second, my app where the same function is just copied and all is compiled in release mode - takes 9-10 seconds.

  10. #10
    Addicted Member
    Join Date
    Jun 2019
    Posts
    247

    Re: Windows 7 - Windows 10 conversion - Slow running

    If the given example is not written in so abusive style for the UI thread, maybe the results will be quite similar on different OSes and same hardware. Actually such example is great to show how not to write UI code...

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    314

    Re: Windows 7 - Windows 10 conversion - Slow running

    Quote Originally Posted by peterst View Post
    If the given example is not written in so abusive style for the UI thread, maybe the results will be quite similar on different OSes and same hardware. Actually such example is great to show how not to write UI code...
    Yes, code would not normally be written like this, as having long running tasks on the UI is not good practice.

    It was written to test the timings, and it has served its purpose

    Sadly no one has been able to explain why there is such a large difference in timings for the same piece of code

  12. #12
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    106,339

    Re: Windows 7 - Windows 10 conversion - Slow running

    I've never noticed any issues with applications running slowly on Win10 before. Your testing suggests that there is a difference but, if you have to abuse the UI thread to demonstrate it, it isn't an issue that will ever affect well-written code. What happens if you test code that doesn't abuse the UI thread like that? Do you still see a significant difference? If not then the issue appears to be limited to UI updates and, since you should generally be avoided lots of those, it should generally not affect you. Perhaps your application is written in such a way as to highlight this difference and the solution is to modify your code to avoid that. A threefold increase in something that doesn't happen often and takes a fraction of a second to complete is not ideal but not something that users would generally even notice.

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    314

    Re: Windows 7 - Windows 10 conversion - Slow running

    I also tested the above code (running on the UI in VS2019) and when running on windows 10, the same sluggish result was obtained

    i have then amended the code so it does not run on the UI

    Code:
    Imports System.Threading
    Public Class Form1
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    
            Dim BitThread As New Thread(AddressOf checktime)
            BitThread.IsBackground = True         'this stops the background thread when the main prog threas stopps
            BitThread.Name = "timecheck"
            BitThread.Start()
    
    
        End Sub
    
    
        Sub checktime()
    
    
            Dim Stopwatch As New Stopwatch()
            Dim i As Integer
            Dim z As String = 0
            Stopwatch.Start()
    
            Debug.WriteLine("============")
            Debug.WriteLine(TimeOfDay)
    
            For i = 1 To 100000000
                z = z + 1
    
            Next
    
            Debug.WriteLine(TimeOfDay)
            Debug.WriteLine("============")
        End Sub
    End Class
    when running this on either windows 7 or windows 10, the same result of 44 seconds was obtained.
    As such I can only conclude that code running on the UI in windows 10 runs very slowly.

    Now whilst the code should not run on the UI, I have lots of (badly written, legacy code) that runs on the UI.

    Has anyone any Idea if there is a parameter (or something in the setup) that can be changed to overcome this problem ?

  14. #14
    Addicted Member
    Join Date
    Jun 2019
    Posts
    247

    Re: Windows 7 - Windows 10 conversion - Slow running

    Refactor code slowly procedure by procedure where users complain. Abusing UI thread has different impact on different OS versions as it is seen from this thread.

    I remember when Win 7 was introduced that some people say "It is faster than XP". No, the UI makes it feel faster. The real calculations are taking exactly the same time. The "responsiveness" of UI from Win 7 seems to be reduced in Win 10 to improve background tasks.

    With current multi-core and multi-thread CPUs, where the new "normal" CPU is at least 6 cores/12 threads could be reason for the changes in Windows about UI thread. Windows 10 thread scheduler was updated many times these years for better support of all new CPUs so who knows what happens under the hood.

  15. #15
    Fanatic Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    666

    Re: Windows 7 - Windows 10 conversion - Slow running

    OK, next step is to provide the hardware specs, cpu/ram &c and the o/s configuration regarding pagefile &c and how the o/s is optimised for foreground/background process &c, if at all. Drive types and location of the o/s and your programs.

    A list of installed and running apps and an overview of the task manager/perf monitor when the program is running on the two operating systems might also be useful. A/V tools and other process monitoring software should be accounted for too.

    I am a windows 10 hater but before I started denigrating the benighted o/s I would always check the machine and o/s to see how the configuration differs.

    I do find that program initiation on Win 10 is considerably slower than Win 7. For example I have a i7 3.4ghz cpu that runs turbo to 4.0ghz with Windows 10 on an SSD. Alongside is a Win7 box with an inferior i7 that only turbo boosts to 3.6ghz running from a standard hard drive. The Windows 7 box always initiates a program quicker than Win 10, there being often a one second delay before Win10 finally does its stuff.

    It tells me there is some tuning to do on that faster box, perhaps turning off a/v tools might be the start.
    Last edited by yereverluvinuncleber; Jan 17th, 2021 at 09:10 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width