Skip to content

Commit 1311ff4

Browse files
authored
docs: a larger initial heap makes a large native import faster (Refs #369) (#494)
1 parent 5dc9d2f commit 1311ff4

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎docs/modules/ROOT/pages/how-to/import-export.adoc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ NOTE: This section is about one file of documents. A file of vertices and edges
218218

219219
`IMPORT DATABASE` runs the same importer from SQL. `IMPORT DATABASE <url>` reads one file, and `IMPORT DATABASE WITH name = value, ...` takes the settings by name. A file of documents loads into the type `Document` unless `documentType` says another. The statement returns one row with `result` and `operation` (`"import database"`).
220220

221+
With the native package, a large import runs faster when the heap starts larger: see xref:installation.adoc#native-import-heap[A larger initial heap for a large import].
222+
221223
The URL is a `file://` URL: `path.resolve().as_uri()` makes one. `as_uri()` writes a space as `%20`, and the engine opens the text after `file://` as a plain path without decoding it. For a folder with a space or another special character in its name, use `import_documents`, which builds the URL without the escaping.
222224

223225
[source,python]

‎docs/modules/ROOT/pages/installation.adoc‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,18 @@ export ARCADEDB_NATIVE_ISOLATE_ARGS="-XX:MaxRAM=4g" # a memory s
261261

262262
When one of these three is present, the package adds no default. Do not use `-XX:MaxRAMPercentage`. The native image does not accept it, and the isolate then fails to start with `graal_create_isolate failed (rc=22)`. The same variable also takes the engine's `-D` settings: see xref:how-to/logs.adoc[Where the logs go]. For what a native image build supports, see {arcadedb-docs-url}/how-to/operations/native-image[Native image] in the main ArcadeDB docs.
263263

264+
[[native-import-heap]]
265+
==== A larger initial heap for a large import
266+
267+
A large `IMPORT DATABASE` runs faster when the heap starts larger. Set the initial size before the Python process starts:
268+
269+
[source,bash]
270+
----
271+
export ARCADEDB_NATIVE_ISOLATE_ARGS="-Xms1g"
272+
----
273+
274+
`-Xms` sets the initial size only, so the default maximum stays. In a test of `{native-pkg-name}` 26.11.1.post4, a graph of 400,000 vertices and 2,000,000 edges imported in 72 s instead of 94 s (0.77 times the default, 95% interval 0.76 to 0.77), and a graph of 100,000 vertices in 11.8 s instead of 13.3 s. The cost is memory: the peak of the importing process rose from 824 MiB to 1,172 MiB for the larger graph. The test ran on two cores of one laptop (https://github.com/ArcadeData/arcadedb-python/issues/369[#369]), so measure on your own data.
275+
264276
[[native-limits]]
265277
=== Limits of the native build
266278

0 commit comments

Comments
 (0)