diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-02-01 11:15:25 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-02-01 11:15:25 +1100 |
| commit | c8bbd4d52c4ab6c9fcd93915cb3fe23fb63e8279 (patch) | |
| tree | c2c131e9fd482b3e9f5fcf4d36e51fbe3fc304d0 | |
| parent | dad159dc3c4ebc89d395b4b695a0626b7be10578 (diff) | |
| download | tangara-fw-c8bbd4d52c4ab6c9fcd93915cb3fe23fb63e8279.tar.gz | |
Reduce leveldb cache sizes and worker stacks, increase number of workers
| -rw-r--r-- | src/database/database.cpp | 4 | ||||
| -rw-r--r-- | src/tasks/tasks.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp index 6b879710..141482ed 100644 --- a/src/database/database.cpp +++ b/src/database/database.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; diff --git a/src/tasks/tasks.cpp b/src/tasks/tasks.cpp index ea174039..d53eface 100644 --- a/src/tasks/tasks.cpp +++ b/src/tasks/tasks.cpp @@ -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() |
