Skip to content

Commit 91a422b

Browse files
authored
Increase default writer heap (fixes #118) (#121)
1 parent e7ffccc commit 91a422b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/index.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,19 @@ impl Index {
243243
/// split between the given number of threads.
244244
///
245245
/// Args:
246-
/// overall_heap_size (int, optional): The total target memory usage of
247-
/// the writer, can't be less than 3000000.
246+
/// overall_heap_size (int, optional): The total target heap memory usage of
247+
/// the writer. Tantivy requires that this can't be less
248+
/// than 3000000 *per thread*. Lower values will result in more
249+
/// frequent internal commits when adding documents (slowing down
250+
/// write progress), and larger values will results in fewer
251+
/// commits but greater memory usage. The best value will depend
252+
/// on your specific use case.
248253
/// num_threads (int, optional): The number of threads that the writer
249254
/// should use. If this value is 0, tantivy will choose
250255
/// automatically the number of threads.
251256
///
252257
/// Raises ValueError if there was an error while creating the writer.
253-
#[pyo3(signature = (heap_size = 3000000, num_threads = 0))]
258+
#[pyo3(signature = (heap_size = 128_000_000, num_threads = 0))]
254259
fn writer(
255260
&self,
256261
heap_size: usize,

0 commit comments

Comments
 (0)