static void Main(string[] args) { var patchFactories = new IPatchFactory[] { //new SetValuePatchFactory(), //new FastMemberPatchFactory(), //new ConstructorInvokePatchFactory(), new ConstructorCompilePatchFactory() }; foreach (var factory in patchFactories) { var thing = new SmallImmutableThing(1, "blah"); var patch = factory.Create <SmallImmutableThing>() .Set(x => x.MyInt, 2) .Set(x => x.MyString, "foo"); GetDurationOf(() => patch.Apply(thing), 1000000, $"{patch.GetType().Name} on small object"); } //var mutableThing = new SmallMutableThing(); //Action mutateThing = () => //{ // mutableThing.MyInt = 2; // mutableThing.MyString = "foo"; //}; //GetDurationOf(mutateThing, 1000000, "Direct mutation of small object"); Console.ReadLine(); }
public void SetUp() { messaging = new MessagingTest(); processor = new PureDataProcessor(); ((PureDataProcessor)processor).Init(testPatch, 0, messaging); patchFactory = new PatchFactory(); patchFactory.Init(); }
public void Init(string[] config) { MainFactory mainFactory = new MainFactory(); processorConfig = mainFactory.Create <IProcessorConfig>(config[0], config[1]); processorConfig.Init(); processor = processorConfig.GetProcessor(); patchGraphManager = mainFactory.Create <IPatchGraphManager>(config[2], config[3]); patchFactory = mainFactory.Create <IPatchFactory>(config[4], config[5]); patchFactory.Init(); serializer = mainFactory.Create <ISerializer>(config[6], config[7]); ((IWaveDrawer)waveDrawer).Init(Others.WavePoints); soundData = new float[Others.WavePoints * 2]; }