Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions source/Handlebars.Benchmark/EndToEnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace HandlebarsNet.Benchmark
{
[MemoryDiagnoser]
public class EndToEnd
{
private object? _data;
Expand Down
1 change: 1 addition & 0 deletions source/Handlebars.Benchmark/LargeArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace HandlebarsNet.Benchmark
{
[MemoryDiagnoser]
public class LargeArray
{
private object _data = null!; // -> Setup()
Expand Down
5 changes: 4 additions & 1 deletion source/Handlebars/Runtime/BoxedValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ namespace HandlebarsDotNet.Runtime
/// </summary>
public static class BoxedValues
{
private const int BoxedIntegersCount = 20;
// Covers iterator indexes for effectively all template loops. The cache is
// ~32KB of process-lifetime statics (1024 boxes + the array), traded against
// a 24-byte allocation per iteration index >= the cache size on every render.
private const int BoxedIntegersCount = 1024;
private static readonly object[] BoxedIntegers = new object[BoxedIntegersCount];

static BoxedValues()
Expand Down
Loading