mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* touching publish.yml * Moved Examples into ./Examples * Moved Benchmarks into ./Tests * Moved Benchmarks into ./Tests * Moved UICatalog into ./Examples * Moved UICatalog into ./Examples 2 * Moved tests into ./Tests * Updated nuget
32 lines
794 B
C#
32 lines
794 B
C#
using BenchmarkDotNet.Attributes;
|
|
using Tui = Terminal.Gui;
|
|
|
|
namespace Terminal.Gui.Benchmarks.ConsoleDrivers.EscSeqUtils;
|
|
|
|
[MemoryDiagnoser]
|
|
// Hide useless column from results.
|
|
[HideColumns ("writer")]
|
|
public class CSI_SetVsWrite
|
|
{
|
|
[Benchmark (Baseline = true)]
|
|
[ArgumentsSource (nameof (TextWriterSource))]
|
|
public TextWriter Set (TextWriter writer)
|
|
{
|
|
writer.Write (Tui.EscSeqUtils.CSI_SetCursorPosition (1, 1));
|
|
return writer;
|
|
}
|
|
|
|
[Benchmark]
|
|
[ArgumentsSource (nameof (TextWriterSource))]
|
|
public TextWriter Write (TextWriter writer)
|
|
{
|
|
Tui.EscSeqUtils.CSI_WriteCursorPosition (writer, 1, 1);
|
|
return writer;
|
|
}
|
|
|
|
public static IEnumerable<object> TextWriterSource ()
|
|
{
|
|
return [StringWriter.Null];
|
|
}
|
|
}
|