Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f5b9cd4
[7.0] Update backport template and servicing docs (#84005)
carlossanlop Mar 28, 2023
57d635b
Create action to check servicing label (#84041)
github-actions[bot] Mar 28, 2023
7786569
Fix piping in yml (#84042)
hoyosjs Mar 28, 2023
4c367c7
Update check-service-labels.yml (#84044)
hoyosjs Mar 28, 2023
8c9da40
[7.0] Avoid using spanish helix queues (#83747)
carlossanlop Mar 28, 2023
80d48e9
[release/7.0] Bump to new OSX 13 AppleTV queue (#83729)
steveisok Mar 29, 2023
74d0f47
[release/7.0] disable NTLM tests on RedHat.7 (#83602)
github-actions[bot] Mar 29, 2023
fb993f5
[release/7.0] Improve servicing docs for Microsoft.Windows.Compatibil…
carlossanlop Mar 29, 2023
1cee763
Fix Iran time zone test case (#84056)
carlossanlop Mar 29, 2023
721e656
Update check-service-labels to trigger on branch edit (#84106)
hoyosjs Mar 30, 2023
05038f9
[release/7.0][mono] Use unsigned char when computing UTF8 string hash…
lambdageek Mar 30, 2023
88b65f9
Ensure that default media type is used when 'null' is passed-in to St…
github-actions[bot] Mar 30, 2023
641393e
[release/7.0] [wasm] ManagedToNativeGenerator: Skip unmanaged dlls (#…
github-actions[bot] Mar 31, 2023
fa133ae
[release/7.0] Use CLOCK_BOOTTIME to calculate BootTime on linux (#675…
simonrozsival Mar 31, 2023
7cd68bc
[release/7.0] JIT: fix bug in cloning conditions for jagged array (#8…
AndyAyersMS Mar 31, 2023
001172f
[release/7.0] Ensure free buffer space when reading TLS messages (#83…
github-actions[bot] Apr 3, 2023
5301032
[release/7.0] SyntaxValueProvider: avoid performance issue with synta…
github-actions[bot] Apr 4, 2023
f8777ff
Fixing a bug that causes us to mistakenly demote a gen2 region to gen…
github-actions[bot] Apr 4, 2023
ed90f14
Fix special sweep issue for workstation (#83342)
github-actions[bot] Apr 4, 2023
eacc9be
[release/7.0] Fix encoding problem when publishing (#83577)
ilonatommy Apr 5, 2023
4a5620b
[release/7.0] [MONO][MARSHAL] Initialize ilgen with a flag (#83813)
github-actions[bot] Apr 5, 2023
0506145
[release/7.0-staging] Update dependencies from dotnet/linker dotnet/m…
dotnet-maestro[bot] Apr 6, 2023
c2d6594
[release/7.0] Fix pinned assembly version 7.0 (#84355)
ericstj Apr 6, 2023
694c2a0
Merge branch 'release/7.0-staging' into release70
carlossanlop Apr 7, 2023
cb70e92
Manually resolve spacing conflict in check-service-labels.yml
carlossanlop Apr 7, 2023
d71dd07
Merge branch 'release70' of github.com:carlossanlop/runtime into rele…
carlossanlop Apr 7, 2023
48abc27
Merge pull request #84459 from carlossanlop/release70
carlossanlop Apr 7, 2023
7e8c33e
Reverting: Set AssemblyName.ProcessorArchitecture for compatibility. …
VSadov Apr 7, 2023
50722b0
[release/7.0] Fix reserving executable memory as per allocation type …
github-actions[bot] Apr 10, 2023
8a0b03e
[release/7.0][Android] Free up more disk space on CI builds (#84567)
steveisok Apr 10, 2023
3947f8d
Update dependencies from https://github.com/dotnet/linker build 20230…
dotnet-maestro[bot] Apr 10, 2023
d566ecf
[7.0] Reset OOB packages from 7.0.5 (#84341)
carlossanlop Apr 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[release/7.0] SyntaxValueProvider: avoid performance issue with synta…
…x list containing many items (#83743)

Co-authored-by: Charles Stoner <[email protected]>
Co-authored-by: Eric StJohn <[email protected]>
  • Loading branch information
3 people authored Apr 4, 2023
commit 5301032950b66d441f7db7e1e78163f3933f85da
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,16 @@ void processMember(
// For any other node, just keep recursing deeper to see if we can find an attribute. Note: we cannot
// terminate the search anywhere as attributes may be found on things like local functions, and that
// means having to dive deep into statements and expressions.
foreach (var child in node.ChildNodesAndTokens().Reverse())
var childNodesAndTokens = node.ChildNodesAndTokens();

// Avoid performance issue in ChildSyntaxList when iterating the child list in reverse
// (see https://github.com/dotnet/roslyn/issues/66475) by iterating forward first to
// ensure child nodes are realized.
foreach (var childNode in childNodesAndTokens)
{
}

foreach (var child in childNodesAndTokens.Reverse())
{
if (child.IsNode)
nodeStack.Append(child.AsNode()!);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
<EnableAOTAnalyzer>true</EnableAOTAnalyzer>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<PackageDescription>Logging abstractions for Microsoft.Extensions.Logging.

Commonly Used Types:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,40 @@ partial class C
Assert.Equal(21, generatedSources[0].SourceText.Lines.Count);
}

[Fact]
public static void SyntaxListWithManyItems()
{
const int nItems = 200000;
var builder = new System.Text.StringBuilder();
builder.AppendLine(
"""
using Microsoft.Extensions.Logging;
class Program
{
[LoggerMessage(EventId = 1, Level = LogLevel.Debug, Message = "M1")]
static partial void M1(ILogger logger)
{
""");
builder.AppendLine(" int[] values = new[] { ");
for (int i = 0; i < nItems; i++)
{
builder.Append("0, ");
}
builder.AppendLine("};");
builder.AppendLine("}");
builder.AppendLine("}");

string source = builder.ToString();
Compilation compilation = CompilationHelper.CreateCompilation(source);
LoggerMessageGenerator generator = new LoggerMessageGenerator();

(ImmutableArray<Diagnostic> diagnostics, _) =
RoslynTestUtils.RunGenerator(compilation, generator);

Assert.Single(diagnostics);
Assert.Equal(DiagnosticDescriptors.LoggingMethodHasBody.Id, diagnostics[0].Id);
}

private static async Task<IReadOnlyList<Diagnostic>> RunGenerator(
string code,
bool wrap = true,
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/System.Text.Json/src/System.Text.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<NoWarn>CS8969</NoWarn>
<IncludeInternalObsoleteAttribute>true</IncludeInternalObsoleteAttribute>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ServicingVersion>2</ServicingVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>3</ServicingVersion>
<!-- This library has been annotated to be AOT safe -->
<EnableAOTAnalyzer>true</EnableAOTAnalyzer>
<PackageDescription>Provides high-performance and low-allocating types that serialize objects to JavaScript Object Notation (JSON) text and deserialize JSON text to objects, with UTF-8 support built-in. Also provides types to read and write JSON text encoded as UTF-8, and to create an in-memory document object model (DOM), that is read-only, for random access of the JSON elements within a structured view of the data.
Expand Down