|
@@ -25,17 +25,17 @@ public class NBodyBenchmark
|
|
|
GC.Collect();
|
|
GC.Collect();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // [Benchmark(Description = "MoonSharp (RunString)")]
|
|
|
|
|
- // public DynValue Benchmark_MoonSharp_String()
|
|
|
|
|
- // {
|
|
|
|
|
- // return core.MoonSharpState.DoString(core.SourceText);
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // [Benchmark(Description = "MoonSharp (RunFile)")]
|
|
|
|
|
- // public DynValue Benchmark_MoonSharp_File()
|
|
|
|
|
- // {
|
|
|
|
|
- // return core.MoonSharpState.DoFile(core.FilePath);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ [Benchmark(Description = "MoonSharp (RunString)")]
|
|
|
|
|
+ public DynValue Benchmark_MoonSharp_String()
|
|
|
|
|
+ {
|
|
|
|
|
+ return core.MoonSharpState.DoString(core.SourceText);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [Benchmark(Description = "MoonSharp (RunFile)")]
|
|
|
|
|
+ public DynValue Benchmark_MoonSharp_File()
|
|
|
|
|
+ {
|
|
|
|
|
+ return core.MoonSharpState.DoFile(core.FilePath);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
[Benchmark(Description = "NLua (DoString)", Baseline = true)]
|
|
[Benchmark(Description = "NLua (DoString)", Baseline = true)]
|
|
|
public object[] Benchmark_NLua_String()
|
|
public object[] Benchmark_NLua_String()
|
|
@@ -43,11 +43,11 @@ public class NBodyBenchmark
|
|
|
return core.NLuaState.DoString(core.SourceText);
|
|
return core.NLuaState.DoString(core.SourceText);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // [Benchmark(Description = "NLua (DoFile)")]
|
|
|
|
|
- // public object[] Benchmark_NLua_File()
|
|
|
|
|
- // {
|
|
|
|
|
- // return core.NLuaState.DoFile(core.FilePath);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ [Benchmark(Description = "NLua (DoFile)")]
|
|
|
|
|
+ public object[] Benchmark_NLua_File()
|
|
|
|
|
+ {
|
|
|
|
|
+ return core.NLuaState.DoFile(core.FilePath);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
[Benchmark(Description = "Lua-CSharp (DoString)")]
|
|
[Benchmark(Description = "Lua-CSharp (DoString)")]
|
|
|
public async Task<LuaValue> Benchmark_LuaCSharp_String()
|
|
public async Task<LuaValue> Benchmark_LuaCSharp_String()
|
|
@@ -56,10 +56,10 @@ public class NBodyBenchmark
|
|
|
return buffer[0];
|
|
return buffer[0];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // [Benchmark(Description = "Lua-CSharp (DoFileAsync)")]
|
|
|
|
|
- // public async Task<LuaValue> Benchmark_LuaCSharp_File()
|
|
|
|
|
- // {
|
|
|
|
|
- // await core.LuaCSharpState.DoFileAsync(core.FilePath, buffer);
|
|
|
|
|
- // return buffer[0];
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ [Benchmark(Description = "Lua-CSharp (DoFileAsync)")]
|
|
|
|
|
+ public async Task<LuaValue> Benchmark_LuaCSharp_File()
|
|
|
|
|
+ {
|
|
|
|
|
+ await core.LuaCSharpState.DoFileAsync(core.FilePath, buffer);
|
|
|
|
|
+ return buffer[0];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|