BenchmarkDotNet=v0.11.5, OS=Windows 10.0.17763.475 (1809/October2018Update/Redstone5)
AMD A4-6300 APU with Radeon(tm) HD Graphics, 1 CPU, 2 logical cores and 1 physical core
.NET Core SDK=2.2.104
[Host] : .NET Core 2.2.2 (CoreCLR 4.6.27317.07, CoreFX 4.6.27318.02), 64bit RyuJIT
Core : .NET Core 2.2.2 (CoreCLR 4.6.27317.07, CoreFX 4.6.27318.02), 64bit RyuJIT
Job=Core Runtime=Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ForVsForeach | |
{ | |
using System.Buffers; | |
using System; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Configs; | |
using BenchmarkDotNet.Jobs; | |
using BenchmarkDotNet.Running; | |
using System.Collections.Generic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class CircullarList<T> | |
{ | |
private readonly IReadOnlyList<T> _data; | |
public CircullarList(IReadOnlyList<T> data) => _data = data; | |
public T Current(in int index) => _data[index]; | |
public T Next(in int index) => _data[index+1 % _data.Count]; | |
public T Previous(in int index) => index-1 > 0 ? _data[index-1] : _data[_data.Count - 1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EntityHolder<TEntity> : IEntityHolder<TEntity> | |
where TEntity : IEntity, new() | |
{ | |
public int Count { get; private set; } | |
public ushort TypeId { get; set; } | |
public Func<TEntity> EntityCreator { get; } | |
public EntityHolder(ushort typeId) | |
{ | |
TypeId = typeId; |