Skip to content

Commit

Permalink
8299970: Speed up compiler/arraycopy/TestArrayCopyConjoint.java
Browse files Browse the repository at this point in the history
Reviewed-by: chagedorn, kvn, thartmann
  • Loading branch information
eme64 committed Feb 13, 2023
1 parent d1c87a0 commit 5d39d14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -232,8 +232,7 @@ public static void main(String [] args) {

setup();

try {
for (int i = 0 ; i < 1000000 ; i++ ) {
for (int i = 0 ; i < 30_000 ; i++ ) {
int index = r.nextInt(2048);
testByte(lengths[i % lengths.length], index , index+2);
reinit(byte.class);
Expand Down Expand Up @@ -262,10 +261,6 @@ public static void main(String [] args) {
reinit(long.class);
testLong_constant_LT64B (index , index+2);
reinit(long.class);
}
System.out.println("PASS : " + validate_ctr);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
37 changes: 16 additions & 21 deletions test/hotspot/jtreg/compiler/arraycopy/TestArrayCopyDisjoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,27 +202,22 @@ public static void main(String [] args) {

setup();

try {
for (int i = 0 ; i < 1000000 ; i++ ) {
testByte(lengths[i % lengths.length], r.nextInt(2048) , r.nextInt(2048));
testByte_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
testByte_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));

testChar(lengths[i % lengths.length] >> 1, r.nextInt(2048) , r.nextInt(2048));
testChar_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
testChar_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));

testInt(lengths[i % lengths.length] >> 2, r.nextInt(2048) , r.nextInt(2048));
testInt_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
testInt_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));

testLong(lengths[i % lengths.length] >> 3, r.nextInt(2048) , r.nextInt(2048));
testLong_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
testLong_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
}
System.out.println("PASS : " + validate_ctr);
} catch (Exception e) {
System.out.println(e.getMessage());
for (int i = 0 ; i < 30_000 ; i++ ) {
testByte(lengths[i % lengths.length], r.nextInt(2048) , r.nextInt(2048));
testByte_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
testByte_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));

testChar(lengths[i % lengths.length] >> 1, r.nextInt(2048) , r.nextInt(2048));
testChar_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
testChar_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));

testInt(lengths[i % lengths.length] >> 2, r.nextInt(2048) , r.nextInt(2048));
testInt_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
testInt_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));

testLong(lengths[i % lengths.length] >> 3, r.nextInt(2048) , r.nextInt(2048));
testLong_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
testLong_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
}
}
}

3 comments on commit 5d39d14

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@Rudometov
Copy link
Member

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 5d39d14 Feb 17, 2023

Choose a reason for hiding this comment

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

@Rudometov the backport was successfully created on the branch Rudometov-backport-5d39d145 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 5d39d145 from the openjdk/jdk repository.

The commit being backported was authored by Emanuel Peter on 13 Feb 2023 and was reviewed by Christian Hagedorn, Vladimir Kozlov and Tobias Hartmann.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev Rudometov-backport-5d39d145:Rudometov-backport-5d39d145
$ git checkout Rudometov-backport-5d39d145
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev Rudometov-backport-5d39d145

Please sign in to comment.