diff --git a/docs/modules/ROOT/pages/how-to/import-export.adoc b/docs/modules/ROOT/pages/how-to/import-export.adoc index bd61a46..52bc5e2 100644 --- a/docs/modules/ROOT/pages/how-to/import-export.adoc +++ b/docs/modules/ROOT/pages/how-to/import-export.adoc @@ -218,6 +218,8 @@ NOTE: This section is about one file of documents. A file of vertices and edges `IMPORT DATABASE` runs the same importer from SQL. `IMPORT DATABASE ` 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"`). +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]. + 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. [source,python] diff --git a/docs/modules/ROOT/pages/installation.adoc b/docs/modules/ROOT/pages/installation.adoc index d100205..ec62ff9 100644 --- a/docs/modules/ROOT/pages/installation.adoc +++ b/docs/modules/ROOT/pages/installation.adoc @@ -261,6 +261,18 @@ export ARCADEDB_NATIVE_ISOLATE_ARGS="-XX:MaxRAM=4g" # a memory s 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. +[[native-import-heap]] +==== A larger initial heap for a large import + +A large `IMPORT DATABASE` runs faster when the heap starts larger. Set the initial size before the Python process starts: + +[source,bash] +---- +export ARCADEDB_NATIVE_ISOLATE_ARGS="-Xms1g" +---- + +`-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. + [[native-limits]] === Limits of the native build