<commit_before>﻿using BenchmarkDotNet.Attributes;
using DspAdpcm.Adpcm;
using DspAdpcm.Adpcm.Formats;

namespace DspAdpcm.Benchmark.BuildParse
{
    public class BuildParseBenchmarks
    {
        [Params(300)]
        public double lengthSeconds;
        [Params(2)]
        public int numChannels;
        private int sampleRate = 48000;

        private AdpcmStream adpcm;
        private byte[] brstm;
        private byte[] bcstm;
        private byte[] bfstm;
        private byte[] dsp;
        private byte[] idsp;

        [Setup]
        public void Setup()
        {
            adpcm = GenerateAudio.GenerateAdpcmEmpty((int)(sampleRate * lengthSeconds), numChannels, sampleRate);
            brstm = new Brstm(adpcm).GetFile();
            idsp = new Idsp(adpcm).GetFile();
            dsp = new Dsp(adpcm).GetFile();
        }

        [Benchmark] public byte[] BuildDsp() => new Dsp(adpcm).GetFile();
        [Benchmark] public byte[] BuildBxstm() => new Brstm(adpcm).GetFile();
        [Benchmark] public byte[] BuildIdsp() => new Idsp(adpcm).GetFile();

        [Benchmark] public Dsp ParseDsp() => new Dsp(dsp);
        [Benchmark] public Brstm ParseBxstm() => new Brstm(brstm);
        [Benchmark] public Idsp ParseIdsp() => new Idsp(idsp);

        [Benchmark] public byte[] RebuildDsp() => new Dsp(dsp).GetFile();
        [Benchmark] public byte[] RebuildBxstm() => new Brstm(brstm).GetFile();<commit_msg>Benchmark: Remove old variables<commit_after>﻿using BenchmarkDotNet.Attributes;
using DspAdpcm.Adpcm;
using DspAdpcm.Adpcm.Formats;

namespace DspAdpcm.Benchmark.BuildParse
{
    public class BuildParseBenchmarks
    {
        [Params(300)]
        public double lengthSeconds;
        [Params(2)]
        public int numChannels;
        private int sampleRate = 48000;

        private AdpcmStream adpcm;
        private byte[] brstm;
        private byte[] dsp;
        private byte[] idsp;

        [Setup]
        public void Setup()
        {
            adpcm = GenerateAudio.GenerateAdpcmEmpty((int)(sampleRate * lengthSeconds), numChannels, sampleRate);
            brstm = new Brstm(adpcm).GetFile();
            idsp = new Idsp(adpcm).GetFile();
            dsp = new Dsp(adpcm).GetFile();
        }

        [Benchmark] public byte[] BuildDsp() => new Dsp(adpcm).GetFile();
        [Benchmark] public byte[] BuildBxstm() => new Brstm(adpcm).GetFile();
        [Benchmark] public byte[] BuildIdsp() => new Idsp(adpcm).GetFile();

        [Benchmark] public Dsp ParseDsp() => new Dsp(dsp);
        [Benchmark] public Brstm ParseBxstm() => new Brstm(brstm);
        [Benchmark] public Idsp ParseIdsp() => new Idsp(idsp);

        [Benchmark] public byte[] RebuildDsp() => new Dsp(dsp).GetFile();
        [Benchmark] public byte[] RebuildBxstm() => new Brstm(brstm).GetFile();
{'fraction_non_alphanumeric': 0.1257122507122507, 'fraction_numerical': 0.00641025641025641, 'mean_word_length': 2.735372340425532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2141834', 'n_tokens_mistral': 926, 'n_tokens_neox': 901, 'n_words': 210}