|
Just in case, I note that to use coroutines, you need to use |
Replies: 1 comment
|
On the main issue -- libmdbx places a reasonable minimum of objects on the stack, so there is no large stack consumption, but this is depends on operations, i.e. from the API functions called in the context of the coroutine:
Even more stack will be required for data modification functions, and additional explanations are needed here:
To estimate stack consumption, you need to know the cursor size. Each cursor is essentially two pairs of arrays of pointers and offsets, each array contains The current size of cursors in non-debugging builds, at the time of this response, is 840 bytes for 64-bit platforms. Therefore, for simplicity, we can assume that at least a kilobyte of stack is required for simple data acquisition operations and an additional With a small amount of data in the b-tree tables, the height will not be large on the order of 2 levels, but it also depends on the ratio of the size of the keys and values to the size of the database page selected during its creation. The larger the page size, the more elements will fit and the smaller the height of the tree will be. And the longer the keys and values are, the smaller it will fit on the page and the higher the height of the tree will be. To simplify, we can say that in simple scenarios with a small database size, I would like to note separately that the estimates of stack space usage do not include the needs of system libraries, in particular malloc() and such as printf() when logging is enabled. |
On the main issue -- libmdbx places a reasonable minimum of objects on the stack, so there is no large stack consumption, but this is depends on operations, i.e. from the API functions called in the context of the coroutine:
In debugging builds, the stack can also be used much more intensively, including for storing buffers used to format data for debugging logging.
The minimum stack size will be required for searching and/or retrieving data using a ready-made cursor by an open source application.
A little more stack will be required for data acquisition/retrieval functions without a cursor, since a temporary cursor will be placed on the stack.
Even more stack will be required for…