-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RDBC-864 Node.js client bulk insert performance #442
Conversation
public async flushIfNeeded(force = false): Promise<void> { | ||
if (this._currentWriter.length > this._maxSizeInBuffer || this._asyncWriteDone) { | ||
if (this.isFlushNeeded() || this._asyncWriteDone) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this._asyncWriteDone
should be in isFlushNeeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. It generates more falses in tryStoreSync, but we wait less overall.
src/Documents/BulkInsertOperation.ts
Outdated
id: string, | ||
metadata?: IMetadataDictionary): boolean { | ||
|
||
if (this.isFlashNeeded() || this._first) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isFlushNeeded
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, first guarantees that stream was ensured and it was initialized.
src/Documents/BulkInsertOperation.ts
Outdated
@@ -851,6 +878,10 @@ export class BulkInsertOperation extends BulkInsertOperationBase<object> { | |||
} | |||
} | |||
|
|||
private isFlashNeeded(): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private isFlashNeeded(): boolean { | |
private isFlushNeeded(): boolean { |
Trying to run with this gives me:
Tried with and without |
When running in debug, it complains about missing
Upgraded to node v20 and it appears to be working |
in 6.0 we require node.js 18+ however node 16 doesn't seem to respect this setting. :( |
https://issues.hibernatingrhinos.com/issue/RDBC-864/Node.js-client-bulk-insert-performance