Search Unity

Very slow when attach Unity to Vs2017

Discussion in 'General Discussion' started by Bagazi, Oct 12, 2018.

  1. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    upload_2018-10-12_17-33-28.png

    When I attach unity to vs2017 for debug,It is very slow ,even as no responses.My vs is professional 2017 and my visual studio tools for unity version is 3.8.0.7 ...
     
  2. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    Post computer specs.
     
    Ryiah likes this.
  3. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,203
    Visual Studio is a very heavy application and it has only gotten worse over the last few years. My previous system - an AMD Phenom II X4 965 @ 3.4GHz, 16GB DDR3-1333, and a 1TB HDD - was about the same age range as the system you're running now.

    Upgrading your processor will make a significant difference but the most important part of your computer for Visual Studio is the one you neglected to tell us. Upgrading my old system from a 1TB HDD to a 512GB SSD brought the start time for Visual Studio from 60 to 90 seconds to 6 to 9 seconds.

    Upgrading the processor and memory - to an AMD Ryzen 5 1600X and 16GB DDR4-2666 - brought the start time down even further. I just timed it after a reboot and it's approximately 2 to 3 seconds at most. Everything else involving it including compiling scripts is massively faster than my previous system.
     
  5. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,779
    I agree, SSD vs HDD makes big difference.
     
  6. BlankDeedxxAldenHilcrest

    BlankDeedxxAldenHilcrest

    Joined:
    Jul 10, 2018
    Posts:
    292
    Thirded because this is real shiz.
     
  7. BrewNCode

    BrewNCode

    Joined:
    Feb 17, 2017
    Posts:
    372
    So moral of the story, wait for cyber monday and buy the best SSD and put it on your machine.
     
  8. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    Change back to Vs2015,seems much quicker...
     
  9. BrewNCode

    BrewNCode

    Joined:
    Feb 17, 2017
    Posts:
    372
    better to plug in a lighter text editor, like VS Code. It never crushes.
     
  10. YunYunYunYunYun

    YunYunYunYunYun

    Joined:
    May 16, 2019
    Posts:
    1
    I use VS Code attach to Unity5.6,it often crash...I have changed back to VS 2019 preview,it seems better,but too slow....
     
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,203
    Most of that will be Unity 5.6. I haven't had a single problem with VS Code on Unity 2017+. That said I don't use it for my main project. I use Script Inspector 3 since it runs right within the Unity editor and is extremely fast and small. Instantly opening scripts is awesome.

    https://assetstore.unity.com/packages/tools/visual-scripting/script-inspector-3-3535
     
  12. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Are you using visual studio greater than 15.7.6?
    A lot of people including myself had the same issue.
    Try reverting to this version if you have.
    I also have another installation of Visual studio 2019. Had the same issue initially but after I cleared all the breakpoints and whitelisted the visualstudio executable on the antivirus scan, it works fine now.
    These tips didn't work for me before, so something may have been fixed with 2019.

    https://developercommunity.visualst...38/vs-2017-1581-debugging-extremely-slow.html
     
  13. BrewNCode

    BrewNCode

    Joined:
    Feb 17, 2017
    Posts:
    372
    Is this Script Inspector 3 in Unity 2017?
     
  14. sxa

    sxa

    Joined:
    Aug 8, 2014
    Posts:
    741
  15. Thorny2000

    Thorny2000

    Joined:
    Sep 18, 2014
    Posts:
    53
    Late reply but might help others:

    Deleting all breakpoints fixes this slow attaching (Debug->Delete All Breakpoints, or CTRL+Shift+F9).

    VS attaching gets slower as time goes on, after a lot of edits and old breakpoints. Maybe internally the system either having too many breakpoints or the old ones now trying to set on invalid addresses take longer to attach as they fail or re-configure.
     
    ExtraCat, aer0ace and ununion like this.
  16. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,779
    VS generally gets slow over the time.
    Sometimes I keep it open for few days. Then I notice significant slowing down.
    Generally not too bad, but may be the case for some.
    Is worth restart it from time to time.
     
    Michoko likes this.
  17. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    If your motherboard supports m.2, I'd go for that. The price tag for m.2 SSD drives has been going down for a while.
     
  18. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    this really save me!
    i9 9900k+32g+2080, but it will need more than ten minutes when attach to unity since yesterday.and by doing this it less than 3 sec.thanks!
     
  19. McSwan

    McSwan

    Joined:
    Nov 21, 2013
    Posts:
    129
    I had a lot of breakpoints and when I "delete all breakpoints" it ran faster - cheers
    upload_2021-9-23_14-4-7.png
     
  20. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,197
    Hi, sorry to bump this, is anyone having this in any 2022 version? I only have one breakpoint and I'm seeing massive hiccups when interacting with the scene view, when I try to do a mouse look in the scene view while in play mode and the debugger is attached this is what I get:
    Screenshot 2022-07-28 211156.png

    Every single mouse click in the scene view causes this...
     
  21. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    Given the thread title, I assume you're attaching Visual Studio to unity editor. Are you MAYBE running out of RAM? Check memory usage when it happens.
     
  22. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,197
    Sorry, completely forgot to get back to you.

    I don't think so, both on my laptop (16gb, always around 6gb free) and my desktop (32gb, always around 21gb free), this is happening. I'm pretty sure I didn't had this in some of the previous versions of the same major version (2022.1.x).

    I will check other versions...
     
  23. RobAtApex

    RobAtApex

    Joined:
    Jun 19, 2017
    Posts:
    21
    Hi guys, I'm also experiencing a weird mega-slow-down, but only when Visual Studio is attached. In our app, we can draw walls. When not drawing walls it maintains 30 fps when running in the Unity Editor. But while drawing walls it drops to about 2.6 fps if VS is attached. If not attached it stays at 30 fps.

    It's a fast new machine, but I don't think specs are relevant here, given it runs fast while attached to VS most of the time.

    Must be something we're doing that is causing VS a lot of extra work at certain times. Any ideas?

    The memory stats in Unity don't show much difference except for GC Allocations per frame jumping from about 379 / 21.0 KB up to about 4000 / 339.0 KB

    Task manager doesn't show much change for CPU or memory except for CPU on VS which goes from close to zero up to about 13%
     
  24. NickJVaccaro

    NickJVaccaro

    Joined:
    Apr 29, 2013
    Posts:
    7
    I'm seeing the exact same issue as you, with the exact same problem areas in the profiler (UIElementsUtility.DoDispatch() & OnGUI()). Did you ever figure out a solution for this? I've somewhat narrowed the problem down to VS2022 - if I revert to VS2019 and attach with that version of the editor, I still get the hiccup but it's much more manageable: 90ms of delay in 2019, 850ms of delay in 2022. And it's only clicks, I can move the scene view camera around using the arrow keys and there's no delay at all.
     
    V-Rangers-Support likes this.
  25. tylearymf_unity

    tylearymf_unity

    Joined:
    May 25, 2022
    Posts:
    12
    I have the same problem in vs2022. :(