diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-04-27 18:42:25 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-04-27 18:42:25 -0500 |
| commit | 8c2802cdda09238818b04f51643183c74818b98f (patch) | |
| tree | 71afa4ffe718d42d06deca3071f3e56574b857d2 /src | |
| parent | 2460cf84334f77be9515c1674a3d710a34479bc9 (diff) | |
| download | slskd-8c2802cdda09238818b04f51643183c74818b98f.tar.gz | |
benchmark load
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Blacklist.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/slskd/Core/Blacklist.cs b/src/slskd/Core/Blacklist.cs index 7b1a46c6..56414ad6 100644 --- a/src/slskd/Core/Blacklist.cs +++ b/src/slskd/Core/Blacklist.cs @@ -20,6 +20,7 @@ namespace slskd; using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Net; @@ -183,6 +184,10 @@ public class Blacklist Log.Debug("Detected blacklist format {Format}", format); } + var sw = new Stopwatch(); + sw.Start(); + Log.Debug("Loading blacklist"); + using var reader = new StreamReader(filename, options: new FileStreamOptions { Access = FileAccess.Read, @@ -283,6 +288,9 @@ public class Blacklist // swap the temporary cache for the "real" cache, enabling a bumpless update Cache = tempCache; + + sw.Stop(); + Log.Debug("Blacklist loaded in {Duration}ms", sw.ElapsedMilliseconds); } /// <summary> |
