Reduce leveldb cache sizes and worker stacks, increase number of workers

custom
jacqueline 1 year ago
parent dad159dc3c
commit c8bbd4d52c
  1. 4
      src/database/database.cpp
  2. 4
      src/tasks/tasks.cpp

@ -141,11 +141,11 @@ auto Database::Open(IFileGatherer& gatherer,
[&]() -> cpp::result<Database*, DatabaseError> {
leveldb::DB* db;
std::unique_ptr<leveldb::Cache> cache{
leveldb::NewLRUCache(24 * 1024)};
leveldb::NewLRUCache(4 * 1024)};
leveldb::Options options;
options.env = sEnv.env();
options.write_buffer_size = 48 * 1024;
options.write_buffer_size = 4 * 1024;
options.max_file_size = 32;
options.block_cache = cache.get();
options.block_size = 512;

@ -66,7 +66,7 @@ auto AllocateStack<Type::kAudioConverter>() -> cpp::span<StackType_t> {
// an eye-wateringly large amount of stack.
template <>
auto AllocateStack<Type::kBackgroundWorker>() -> cpp::span<StackType_t> {
std::size_t size = 256 * 1024;
std::size_t size = 64 * 1024;
return {static_cast<StackType_t*>(heap_caps_malloc(size, MALLOC_CAP_SPIRAM)),
size};
}
@ -125,7 +125,7 @@ auto WorkerPool::Main(void* q) {
}
}
static constexpr size_t kNumWorkers = 3;
static constexpr size_t kNumWorkers = 4;
static constexpr size_t kMaxPendingItems = 8;
WorkerPool::WorkerPool()

Loading…
Cancel
Save