Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[SPARK-55789][CORE][TESTS] Add a microbenchmark for Platform #54570

Closed
LuciferYang wants to merge 6 commits intoapache:masterfrom
LuciferYang:SPARK-55789
Closed

[SPARK-55789][CORE][TESTS] Add a microbenchmark for Platform #54570
LuciferYang wants to merge 6 commits intoapache:masterfrom
LuciferYang:SPARK-55789

Conversation

@LuciferYang
Copy link
Contributor

What changes were proposed in this pull request?

This pr aims to add a microbenchmark for Platform.

Why are the changes needed?

Platform is a fundamental utility class that is heavily reliant on the underlying JDK implementation. Adding a microbenchmark allows for better observation of its performance discrepancies across different JDK versions, facilitating timely and targeted optimization.

Does this PR introduce any user-facing change?

No

How was this patch tested?

  • Pass Github Actions

Was this patch authored or co-authored using generative AI tooling?

No

@LuciferYang LuciferYang marked this pull request as draft March 2, 2026 09:35
* @param dst The destination integer array.
* @param count The number of integers to copy.
*/
public static void copyToIntArrayManual(Object src, long srcOffset, int[] dst, int count) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This portion of code needs to be extracted into Java in order to simulate performance similar to the loop-based assignment in OnHeapColumnVector. If placed in Scala code, it will become slower, even when using a while loop.

@LuciferYang LuciferYang marked this pull request as ready for review March 2, 2026 12:48
@LuciferYang
Copy link
Contributor Author

cc @dongjoon-hyun and @pan3793

override def runBenchmarkSuite(mainArgs: Array[String]): Unit = {
val count4k = 4 * 1024 // 4k elements
val str4k = "4k"
val count16k = 16 * 1024 // 8k elements
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment seems to be outdated. Maybe, 16k elements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

val str16k = "16k"
val count256k = 256 * 1024 // 256k elements
val str256k = "256k"
val count1m = 1 * 1024 * 1024 // 8M elements
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8M -> 1M.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

dongjoon-hyun
dongjoon-hyun approved these changes Mar 3, 2026
@LuciferYang
Copy link
Contributor Author

The test failure for "'Run / Run Docker integration tests'" is irrelevant.

@LuciferYang
Copy link
Contributor Author

Merged into master. Thanks @dongjoon-hyun @HyukjinKwon and @pan3793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants