aspnetcore/test/Microsoft.AspNet.Razor.Test
Ryan Nowak 42acfe43ad Fix aspnet/Mvc#3196 Razor Compilation Allocations
This change significantly reduces the amount of string and List<ISymbol>
allocations that occur during compilation by changing the way
LiteralChunks are combined.

This is a low impact fix that addresses the performance issue, the design
issues that caused it still exist.

The problem here lies in what Razor fundamentally does - it parses HTML/C#
into tokens, and then combines them back into 'chunks' a representation
friendly to code generation. When presenting with a large block of static
HTML, Razor parses it into individual HTML tokens, and then tries to join
them in back into a single chunk for rendering. Due to details of Razor's
representation of chunks/tokens, the process of combining literals is too
expensive.

Mainly, what's done here is to not try to combine instances of
LiteralChunk. The process of merging them is too expensive and requires
lots of interm List<ISymbol> and string allocations.

Instead we produce a new 'chunk' ParentLiteralChunk, which doesn't do so
much up-front computing. Various pieces of the code that deal with
LiteralChunk need to be updated to deal with ParentLiteralChunk also,
which is the bulk of the changes here.

Note that we still have the potential for LOH allocations to occur during
codegen, but it's likely to occur O(1) for each large block of HTML
instead of O(N) as it did in the old code.
2015-11-18 12:51:11 -08:00
..
Chunks/Generators Fix aspnet/Mvc#3196 Razor Compilation Allocations 2015-11-18 12:51:11 -08:00
CodeGenerators Update tests to not require quotes for TH directives. 2015-11-06 12:19:40 -08:00
Editor
Framework Update tests to not require quotes for TH directives. 2015-11-06 12:19:40 -08:00
Parser Update tests to not require quotes for TH directives. 2015-11-06 12:19:40 -08:00
TagHelpers Update tests to not require quotes for TH directives. 2015-11-06 12:19:40 -08:00
TestFiles Update tests to not require quotes for TH directives. 2015-11-06 12:19:40 -08:00
Text
Tokenizer
Utils
CSharpRazorCodeLanguageTest.cs
Microsoft.AspNet.Razor.Test.xproj
RazorCodeLanguageTest.cs
RazorEngineHostTest.cs
RazorErrorTest.cs
RazorTemplateEngineTest.cs
SourceLocationTest.cs
StringTextBuffer.cs
project.json Remove System beta tag in project.json for coreclr packages. 2015-11-12 12:23:22 -08:00