Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perf issues editing files with nested #if and #region #5394

Closed
KevinH-MS opened this issue Sep 22, 2015 · 6 comments
Closed

Perf issues editing files with nested #if and #region #5394

KevinH-MS opened this issue Sep 22, 2015 · 6 comments
Labels
Area-IDE Tenet-Performance Regression in measured performance of the product from goals. Verified
Milestone

Comments

@KevinH-MS
Copy link
Contributor

  1. Create a C# Console App with the code below.
  2. Place the cursor at the end of the last #region in Class1 and hit {Enter}

RESULTS:
VS becomes unresponsive and newline is not inserted for 5-6 seconds...

#define Var1

using System;
using System.Collections.Generic;

class Class1
{
#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif

#if (false && Var1)
    Dictionary<int, List<string>> x = new Dictionary<int, List<string>>() {
    #region Region 1
        {
            1,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 2
        {
            2,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 3
        {
            3,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 4
        {
            4,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 5
        {
            5,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 6
        {
            6,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 7
        {
            7,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 8
        {
           8,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 9
        {
            9,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        },
    #endregion
    #region Region 10
        {
            10,
            new List<string>()
            {
                "a",
                "b",
                "c",
                "d",
                "e",
                "f"
            }
        }
    #endregion
    };
#endif
}

class Program
{
    static void Main()
    {
    }
}
@KevinH-MS KevinH-MS added Area-IDE Tenet-Performance Regression in measured performance of the product from goals. labels Sep 22, 2015
@KevinH-MS KevinH-MS added this to the 1.1 milestone Sep 22, 2015
@pharring
Copy link
Contributor

Did you repro this with 1.0 or with 1.1 because we made an Update 1 fix with #3515

@KevinH-MS
Copy link
Contributor Author

I'm on RTM patched with the latest Roslyn bits.

@pharring
Copy link
Contributor

Does it repro with "smart indent" disabled?

@rchande
Copy link
Contributor

rchande commented Sep 22, 2015

"Block indent" is equally slow; "None" is fast.

rchande pushed a commit to rchande/roslyn that referenced this issue Sep 22, 2015
Avoid repeatedly calling ISyntaxFactsService.IsInInactiveRegion, which calls SyntaxTree.GetToken. GetToken needs to traverse directive trivia to find the token it is
attached to. This results in n ^ 2 traversals of the tree if there are repeated directive before the line to indent. Additionally, when the indenter determines
that it's examining a line inside a disabled region, instead of examining the previous line, it examines the first line preceeding the current line that isn't
inside a disabled region.

Fixes dotnet#5394.
rchande pushed a commit that referenced this issue Sep 23, 2015
Speed up smart indenting in the presence of many inactive regions

Fixes #5394.
@rchande rchande assigned KevinH-MS and unassigned rchande Sep 23, 2015
@rchande
Copy link
Contributor

rchande commented Sep 23, 2015

Please verify, @KevinH-MS.

@KevinH-MS
Copy link
Contributor Author

Played around a bit with updated bits... LGTM 👍

@KevinH-MS KevinH-MS removed their assignment Sep 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Tenet-Performance Regression in measured performance of the product from goals. Verified
Projects
None yet
Development

No branches or pull requests

3 participants