Open edko99 opened 2 weeks ago
This does not seem to be an iOS only problem. I created the same project targeting macOS, and it has exactly the same issue. DuckDB does not seem to allocate all the available memory that could potentially be available to it.
I am experimenting with DuckDB on iOS and visionOS. I was able to make it run both on the simulator and on device with ease. However, when working with larger databases, the performance degrades. It does make use of multiple threads, but does not take advantage of available memory.
I've created a default SwiftUI project and have added DuckDB 1.1.2 as a dependency. Using the CLI, I have created a test database and have saved it in a folder inside the project. The commands to create the database were:
I called the database
tpch.duckdb
. The project's structure looks like this:The content of
ContentView.swift
is:When I run this (either on the simulator or a device) and press the "test" button, the query takes around 2 minutes. The same query on a Mac (CLI) returns almost immediately. It does use 10 threads but the memory usage does not go above 182MB, despite several GB being available (and having set
memory_limit
andmax_memory
to 4GB).