https://github.com/openjdk/jdk/pull/14227 Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} openjdk / jdk Public * Notifications * Fork 4.6k * Star 16k * Code * Pull requests 273 * Security * Insights More * Code * Pull requests * Security * Insights 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. Pick a username [ ] Email Address [ ] Password [ ] [ ] Sign up for GitHub 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 Jump to bottom 8309130: x86_64 AVX512 intrinsics for Arrays.sort methods (int, long, float and double arrays) #14227 Open vamsi-parasa wants to merge 3 commits into openjdk:master base: master Choose a base branch [ ] Branches Tags Could not load branches Branch not found: {{ refName }} {{ refName }} default Could not load tags Nothing to show {{ refName }} default Are you sure you want to change the base? Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated. Change base from vamsi-parasa:avx512sort Open 8309130: x86_64 AVX512 intrinsics for Arrays.sort methods (int, long, float and double arrays) #14227 vamsi-parasa wants to merge 3 commits into openjdk:master from vamsi-parasa:avx512sort +2,907 -9 Conversation 5 Commits 3 Checks 18 Files changed 18 Conversation This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters vamsi-parasa Copy link Contributor @vamsi-parasa vamsi-parasa commented May 30, 2023 * edited by openjdk bot The goal is to develop faster sort routines for x86_64 CPUs by taking advantage of AVX512 instructions. This enhancement provides an order of magnitude speedup for Arrays.sort() using int, long, float and double arrays. This PR shows upto ~13x improvement for 32-bit datatypes (int, float) and upto 8x improvement for 64-bit datatypes (long, double) as shown in the performance data below. Arrays.sort performance data using JMH benchmarks Arrays.sort benchmark Array Baseline (us/ AVX512 Sort (us/ Speedup Size op) op) ArraysSort.doubleSort 100 0.639 0.217 2.9x ArraysSort.doubleSort 1000 8.707 3.421 2.5x ArraysSort.doubleSort 10000 349.267 43.56 8.0x ArraysSort.doubleSort 100000 4721.17 579.819 8.1x ArraysSort.floatSort 100 0.722 0.129 5.6x ArraysSort.floatSort 1000 9.1 2.356 3.9x ArraysSort.floatSort 10000 336.472 26.706 12.6x ArraysSort.floatSort 100000 4804.716 427.397 11.2x ArraysSort.intSort 100 0.61 0.111 5.5x ArraysSort.intSort 1000 8.534 2.025 4.2x ArraysSort.intSort 10000 310.97 24.082 12.9x ArraysSort.intSort 100000 4484.94 381.01 11.8x ArraysSort.longSort 100 0.636 0.28 2.3x ArraysSort.longSort 1000 8.646 4.425 2.0x ArraysSort.longSort 10000 322.116 53.094 6.1x ArraysSort.longSort 100000 4448.171 696.773 6.4x --------------------------------------------------------------------- Progress * [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer) * [*] Change must not contain extraneous whitespace * [*] Commit message must refer to an issue Issue * JDK-8309130: x86_64 AVX512 intrinsics for Arrays.sort methods (int, long, float and double arrays) Reviewing Using git Checkout this PR locally: $ git fetch https://git.openjdk.org/jdk.git pull/14227/head:pull/ 14227 $ git checkout pull/14227 Update a local copy of the PR: $ git checkout pull/14227 $ git pull https://git.openjdk.org/jdk.git pull/14227/head Using Skara CLI tools Checkout this PR locally: $ git pr checkout 14227 View PR using the GUI difftool: $ git pr show -t 14227 Using diff file Download this PR as a diff file: https://git.openjdk.org/jdk/pull/14227.diff Webrev Link to Webrev Comment Sorry, something went wrong. 1 IvanVas reacted with thumbs up emoji [?] 1 LifeIsStrange reacted with heart emoji 12 lvca, jwenjian, andreis, sergivb01, kinow, LifeIsStrange, alphaho, MWHunter, PhaseRush, Congee, and 2 more reacted with rocket emoji All reactions * 1 reaction * [?] 1 reaction * 12 reactions @vamsi-parasa 8309130: x86_64 AVX512 intrinsics for Arrays.sort methods (int, long,... ... e98e5ef ... float and double arrays) @bridgekeeper Copy link bridgekeeper bot commented May 30, 2023 Welcome back vamsi-parasa! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request. All reactions Sorry, something went wrong. @vamsi-parasa Copy link Contributor Author vamsi-parasa commented May 30, 2023 /label hotspot-compiler All reactions Sorry, something went wrong. @openjdk openjdk bot added rfr Pull request is ready for review hotspot-compiler hotspot-compiler-dev@openjdk.org labels May 30, 2023 @openjdk Copy link openjdk bot commented May 30, 2023 @vamsi-parasa The hotspot-compiler label was successfully added. All reactions Sorry, something went wrong. @mlbridge Copy link mlbridge bot commented May 30, 2023 * edited Webrevs * 02: Full - Incremental (6d140d5b) * 01: Full - Incremental (923a7cae) * 00: Full (e98e5ef4) All reactions Sorry, something went wrong. vamsi-parasa added 2 commits May 30, 2023 12:54 @vamsi-parasa remove libstdc++ 923a7ca @vamsi-parasa Merge branch 'master' of https://git.openjdk.java.net/jdk into avx512... ... 6d140d5 ...sort @xueyuanl xueyuanl mentioned this pull request May 31, 2023 Daily Hacker News 31-05-2023 xueyuanl/daily-hackernews#996 Open @theRealAph Copy link Contributor theRealAph commented May 31, 2023 What happens to really short arrays? Your patch should include macro benchmarks for e.g. 50 and 10. All reactions Sorry, something went wrong. Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Reviewers No reviews Assignees No one assigned Labels hotspot-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review Milestone No milestone 2 participants @vamsi-parasa @theRealAph Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.