<commit_before>﻿using Leto.Internal;
using System;
using System.Buffers;
using System.Buffers.Pools;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace Leto.ConnectionStates.SecretSchedules
{
    public class SecretSchedulePool : IDisposable
    {
        const int MaxHashSize = 64;
        const int MaxKeySize = 32 + 12;
        const int Session_MaxHashBlocks = 6;
        const int Session_MaxKeys = 2;
        const int MaxInflightSessions = 1000;
        public const int MaxInflightConnections = 5000;
        const int Session_Size = MaxHashSize * Session_MaxHashBlocks;

        private BufferPool _ephemeralSessionPool;
        private BufferPool _ephemeralKeysPool;

        public SecretSchedulePool()
        {
            _ephemeralSessionPool = EphemeralBuffers.EphemeralBufferPool.CreateBufferPool(Session_Size, MaxInflightSessions);
            _ephemeralKeysPool = EphemeralBuffers.EphemeralBufferPool.CreateBufferPool(MaxKeySize, MaxInflightConnections * 2);
        }

        public OwnedBuffer<byte> GetSecretBuffer()
        {
            var session = _ephemeralSessionPool.Rent(Session_Size);
            return session;<commit_msg>Secrets reduced<commit_after>﻿using Leto.Internal;
using System;
using System.Buffers;
using System.Buffers.Pools;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace Leto.ConnectionStates.SecretSchedules
{
    public class SecretSchedulePool : IDisposable
    {
        const int MaxHashSize = 64;
        const int MaxKeySize = 32 + 12;
        const int Session_MaxHashBlocks = 6;
        const int Session_MaxKeys = 2;
        const int MaxInflightSessions = 200;
        public const int MaxInflightConnections = 500;
        const int Session_Size = MaxHashSize * Session_MaxHashBlocks;

        private BufferPool _ephemeralSessionPool;
        private BufferPool _ephemeralKeysPool;

        public SecretSchedulePool()
        {
            _ephemeralSessionPool = EphemeralBuffers.EphemeralBufferPool.CreateBufferPool(Session_Size, MaxInflightSessions);
            _ephemeralKeysPool = EphemeralBuffers.EphemeralBufferPool.CreateBufferPool(MaxKeySize, MaxInflightConnections * 2);
        }

        public OwnedBuffer<byte> GetSecretBuffer()
        {
            var session = _ephemeralSessionPool.Rent(Session_Size);
            return session;
{'fraction_non_alphanumeric': 0.060380479735318446, 'fraction_numerical': 0.013234077750206782, 'mean_word_length': 3.304270462633452, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3314833', 'n_tokens_mistral': 725, 'n_tokens_neox': 655, 'n_words': 148}