mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-12-27 15:20:19 -05:00
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
24 lines
514 B
C#
24 lines
514 B
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using BenchmarkDotNet.Attributes;
|
|
|
|
namespace API.Benchmark;
|
|
|
|
[MemoryDiagnoser]
|
|
public class CleanTitleBenchmarks
|
|
{
|
|
private static IList<string> _names;
|
|
|
|
[GlobalSetup]
|
|
public static void LoadData() => _names = File.ReadAllLines("Data/Comics.txt");
|
|
|
|
[Benchmark]
|
|
public static void TestCleanTitle()
|
|
{
|
|
foreach (var name in _names)
|
|
{
|
|
Services.Tasks.Scanner.Parser.Parser.CleanTitle(name, true);
|
|
}
|
|
}
|
|
}
|