Added buffer size for used BufferedOutputStream#16
Added buffer size for used BufferedOutputStream#16kowalczm wants to merge 2 commits intobytefish:masterfrom kowalczm:master
Conversation
Upgraded postgrsql jdbc driver to 42.2.2
|
Thanks for the Pull Request! 🙏 I will need some time to review it. Do you have any figures on performance improvements? |
|
I have played with 'IntegrationTest.java' and see that having configrable buffer size we can control how many calls are done for Postgres Db and see significant performance improvment when sending data. So for larger buffer size than default in PGCopyOutputStream (65536) we are deacresing calls to db. Additionality byte array copying from BufferedOutputStream to PGCopyOutputStream is removed when BufferedOutputStream buffer size is less that PGCopyOutputStream buffer size. |
|
Sorry for my very late reply. I am now reviewing it. |
|
@kowalczm Could you explain, why you are setting the Buffer Size to new DataOutputStream(new BufferedOutputStream(new PGCopyOutputStream(copyIn, 1), bufferSize)); |
|
@kowalczm Ah I get it. The |
Improvements to PgBinaryWriter. Thanks a lot to Mariusz (@kowalczm)!
|
Yes, I have read through the Postgres JDBC Driver code. I see two options here...
If one uses the 2. approach, then at the end of the day the I have opted to go for the 1. option, that you have used as well. If it mysteriously breaks, then we will use the 2. approach. The |
Add a Configuration class to modify the Write Buffer Size for possible Performance modifications. Add a Default Configuration. Use the Configuration in the PgBulkInsert class.
|
Released Version 2.1 with a Configurable Buffer Size. Thanks! 👍 |
Upgraded postgrsql jdbc driver to 42.2.2