Skip to content

Commit

Permalink
Add configurable symbol table block size when the sepcified size is s…
Browse files Browse the repository at this point in the history
…maller than 32K.
  • Loading branch information
linlin-s committed Dec 5, 2023
1 parent 173e702 commit cb5b43f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ public void setStreamCopyOptimized(final boolean optimized)

public void setBlockSize(int size) {
myBinaryWriterBuilder.withUserBlockSize(size);
// Adjust the symbol table block size when the user block size is smaller than the default, because in most cases, the symbol table is smaller than the data.
if (size < myBinaryWriterBuilder.DEFAULT_BLOCK_SIZE) {
myBinaryWriterBuilder.withSymbolsBlockSize(size);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public IvmMinimizing getIvmMinimizing()
public abstract IonBinaryWriterBuilder withLocalSymbolTableAppendDisabled();

/**
* Specify the default block size for write buffer.
* Specify the block size for write buffer.
* @param size represent the specified block size in bytes.
* If this functionality is not set, the default block size is 32768 bytes.
*/
Expand Down

0 comments on commit cb5b43f

Please sign in to comment.