Performance of JDBC batch inserts & upserts

Hey I am new to Cockroach and recently started testing it out for further use.
I was trying to do a batch insert of about 300,000 rows to one table and another 300,000 upserts into another using jdbc prepared statement …and then execute batch.
It took roughly 22 mins for the whole operation …i guess about 11 mins each.
This was prepared statement
db.prepareStatement("INSERT INTO items.field_data (item_id, field_id, timestamp, user, data)
“VALUES (?, ?, ?, ?, ?)”)
//…set params

This is the table I am inserting to
CREATE TABLE items.field_data (
item_id INT NOT NULL,
field_id INT NOT NULL,
timestamp INT NOT NULL,
PRIMARY KEY (item_id, timestamp, field_id)
I am testing against a regular default cluster with 3 nodes each with 16 GB memory.

Any tips or pointers to improve the performance or something I am not doing right?

We’ve found that inserting about 500 rows at a time is fastest. I think it’s currently faster to insert multiple rows in a single statement with many parameters ("INSERT INTO items.field_data (...) VALUES " + String.join(", ", Collections.nCopies(500, "(?, ?, ?, ?, ?)")) than to use a JDBC batch.