Skip to content

Instantly share code, notes, and snippets.

View vgrudenic's full-sized avatar

Vedran Grudenic vgrudenic

View GitHub Profile
# error Add a NUGET reference to BenchMarkDotNet
void Main()
{
new LookupTest().Validate();
BenchmarkRunner.Run<LookupTest>();
}
public class LookupTest
{
@vgrudenic
vgrudenic / StructsVsClassesTestUnity.cs
Created May 15, 2017 11:52
Comparing struct/class access with shuffled arrays
using System;
using UnityEngine;
class TestScript : MonoBehaviour
{
struct ProjectileStruct
{
public Vector3 Position;
public Vector3 Velocity;
@vgrudenic
vgrudenic / StructsVsClassesTest.cs
Created May 13, 2017 18:33
Comparison of struct and class arrays in C#
using System;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Structs_vs_classes_array_test
{
// code slightly modified from the Jackson Dunstan's article
// How to Write Faster Code Than 90% of Programmers
// http://jacksondunstan.com/articles/3860