remove debug code

This commit is contained in:
Jeremy Wu
2019-09-11 08:05:20 +10:00
parent 81e252d564
commit 24debbf349

View File

@@ -32,7 +32,7 @@ namespace Wox.Plugin.Program
_settingsStorage = new PluginJsonStorage<Settings>(); _settingsStorage = new PluginJsonStorage<Settings>();
_settings = _settingsStorage.Load(); _settings = _settingsStorage.Load();
var preloadcost = Stopwatch.Normal("|Wox.Plugin.Program.Main|Preload programs cost", () => Stopwatch.Normal("|Wox.Plugin.Program.Main|Preload programs cost", () =>
{ {
_win32Storage = new BinaryStorage<Win32[]>("Win32"); _win32Storage = new BinaryStorage<Win32[]>("Win32");
_win32s = _win32Storage.TryLoad(new Win32[] { }); _win32s = _win32Storage.TryLoad(new Win32[] { });
@@ -42,47 +42,19 @@ namespace Wox.Plugin.Program
Log.Info($"|Wox.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>"); Log.Info($"|Wox.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>");
Log.Info($"|Wox.Plugin.Program.Main|Number of preload uwps <{_uwps.Length}>"); Log.Info($"|Wox.Plugin.Program.Main|Number of preload uwps <{_uwps.Length}>");
//########DELETE
long win32indexcost = 0;
long uwpindexcost = 0;
var a = Task.Run(() => var a = Task.Run(() =>
{ {
if (!_win32s.Any()) if (!_win32s.Any())
win32indexcost = Stopwatch.Normal("|Wox.Plugin.Program.Main|Win32Program index cost", IndexWin32Programs); Stopwatch.Normal("|Wox.Plugin.Program.Main|Win32Program index cost", IndexWin32Programs);
}); });
var b = Task.Run(() => var b = Task.Run(() =>
{ {
if (!_uwps.Any()) if (!_uwps.Any())
uwpindexcost = Stopwatch.Normal("|Wox.Plugin.Program.Main|Win32Program index cost", IndexUWPPrograms); Stopwatch.Normal("|Wox.Plugin.Program.Main|Win32Program index cost", IndexUWPPrograms);
}); });
Task.WaitAll(a, b); Task.WaitAll(a, b);
//########DELETE
/*
* With roaming folder already
Preload programs cost <24ms>
Program index cost <3163ms>
no roaming yet (clean)
Preload programs cost <79ms>
Program index cost <2900ms>
*
*
*/
long totalindexcost = win32indexcost + uwpindexcost;
if (preloadcost > 70 || totalindexcost > 4000)
{
#if DEBUG
#else
throw e
#endif
}
//########DELETE
} }
public void Save() public void Save()