dajac opened a new pull request, #24183: URL: https://github.com/apache/kafka/pull/24183
Since 598caf0864 (MINOR: Make the message array length limit configurable), Java CI builds that run the `clients` tests have been hitting the 210-minute timeout, on PRs and on trunk. That commit adds `testArrayLengthAboveDefaultMaxIsAcceptedWhenRaised` to `SimpleArraysMessageTest`, which reads an array of 1,000,001 entries keyed by consecutive `int32` values. The test runs for 2h19m to 2h52m on CI. The time goes into `ImplicitLinkedHashCollection.changeCapacity`. It removes each element from the old array before inserting it into the new one, and each removal reseats every element up to the next empty slot, so a resize is quadratic when the hash codes form long probe runs. Generated keyed collections with an `int32` map key hash to the key itself, so consecutive keys fill a single run. Adding 100,000 consecutive keys to a collection presized for 1,000, as generated readers do, takes about 17 seconds. The resize has worked this way since the class was added; the new test is the first to read such a large array. This patch copies the elements into the new array in insertion order and drops the old array without removing anything from it. The new array and links are the same as before. Adding 100,000 and 1,000,001 consecutive keys now takes about 5 ms and 14 ms, and the test about 60 ms locally. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
