static void DevRun() { System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); var opts = new Options(); opts.ExecutionMode = ExecutionMode.Serial; ProtoCore.Core core = new Core(opts); core.Compilers.Add(ProtoCore.Language.Associative, new ProtoAssociative.Compiler(core)); core.Compilers.Add(ProtoCore.Language.Imperative, new ProtoImperative.Compiler(core)); #if DEBUG core.Options.DumpByteCode = true; core.Options.Verbose = true; #else core.Options.DumpByteCode = false; core.Options.Verbose = false; #endif ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper()); ProtoScriptRunner runner = new ProtoScriptRunner(); // Assuming current directory in test/debug mode is "...\Dynamo\bin\AnyCPU\Debug" runner.LoadAndExecute(@"..\..\..\test\core\dsevaluation\DSFiles\test.ds", core); long ms = sw.ElapsedMilliseconds; sw.Stop(); Console.WriteLine(ms); Console.ReadLine(); }
static void Run(string filename, bool verbose) { if (!File.Exists(filename)) { Console.WriteLine("Cannot find file " + filename); return; } System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); var opts = new Options(); opts.ExecutionMode = ExecutionMode.Serial; ProtoCore.Core core = new Core(opts); core.Compilers.Add(ProtoCore.Language.Associative, new ProtoAssociative.Compiler(core)); core.Compilers.Add(ProtoCore.Language.Imperative, new ProtoImperative.Compiler(core)); core.Options.DumpByteCode = verbose; core.Options.Verbose = verbose; ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper()); ProtoScriptRunner runner = new ProtoScriptRunner(); runner.LoadAndExecute(filename, core); long ms = sw.ElapsedMilliseconds; sw.Stop(); Console.WriteLine(ms); }
static void Run(string filename, bool verbose) { if (!File.Exists(filename)) { Console.WriteLine("Cannot find file " + filename); return; } var profilingThread = new Thread(new ThreadStart(CollectingMemory)); profilingThread.Start(); System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); var opts = new Options(); opts.ExecutionMode = ExecutionMode.Serial; ProtoCore.Core core = new Core(opts); core.Compilers.Add(ProtoCore.Language.Associative, new ProtoAssociative.Compiler(core)); core.Compilers.Add(ProtoCore.Language.Imperative, new ProtoImperative.Compiler(core)); core.Options.DumpByteCode = verbose; core.Options.Verbose = verbose; ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper()); ProtoScriptRunner runner = new ProtoScriptRunner(); runner.LoadAndExecute(filename, core); long ms = sw.ElapsedMilliseconds; sw.Stop(); done = true; profilingThread.Join(); Console.WriteLine("{0},{1},{2}", ms, maxNetMemory, maxPrivateWorkingSet); }
static void Run(string filename, bool verbose) { if (!File.Exists(filename)) { Console.WriteLine("Cannot find file " + filename); return; } var opts = new Options(); opts.ExecutionMode = ExecutionMode.Serial; ProtoCore.Core core = new Core(opts); core.Compilers.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Compiler(core)); core.Compilers.Add(ProtoCore.Language.kImperative, new ProtoImperative.Compiler(core)); core.Options.DumpByteCode = verbose; core.Options.Verbose = verbose; ProtoFFI.DLLFFIHandler.Register(ProtoFFI.FFILanguage.CSharp, new ProtoFFI.CSModuleHelper()); ProtoScriptRunner runner = new ProtoScriptRunner(); RuntimeCore runtimeCore = runner.LoadAndExecute(filename, core); ExecutionMirror mirror = runtimeCore.Mirror; }