Skip to content

dubi253/openjdk

 
 

Repository files navigation

COMP390 - Honours Year Computer Science Project - 2023/24

Project Title:

Bring Powersort to Java

Java Doc and Test Report

https://dubi253.github.io/openjdk/

Powersort:

https://www.wild-inter.net/publications/munro-wild-2018

Code Reference

Java: https://github.com/sebawild/nearly-optimal-mergesort-code

C++: https://github.com/sebawild/powersort

Currently changed files:

Build Jtreg

clone jtreg repository

git clone https://github.com/openjdk/jtreg.git

add JAVA_HOME to your environment variables, change to your java home directory if necessary

export JAVA_HOME=/usr/lib/jvm/java

go to jtreg directory

cd jtreg

build jtreg

sh make/build.sh

add jtreg to your PATH

export JTREG_HOME=[your jtreg root directory]/build/images/jtreg
export PATH=$PATH:$JAVA_HOME/bin:$JTREG_HOME/bin

All done, you can now use jtreg to test your openjdk build.

jtreg -h

Build OpenJDK

https://openjdk.org/groups/build/doc/building.html

Optional - clean make if necessary

make dist-clean

Normal build

If you have jtreg installed and env PATH, you can run the following command to build the JDK:

bash configure

("../jtreg/" is my jtreg directory, change to yours if necessary)

bash configure --with-jtreg=../jtreg/
make images

Test Powersort

You can run the test with any of the following commands:

make test TEST="jdk_powersort"
 jtreg -verbose:all -jdk:build/linux-x86_64-server-release/jdk test/jdk/java/util/PowerSort/PowerSortTest.java

Flame Graphs Visualisation

Install AsyncProfiler at https://github.com/async-profiler/async-profiler

Enable perf_event_paranoid and disable kptr_restrict for async-profiler to work

sudo sysctl kernel.perf_event_paranoid=1 && sudo sysctl kernel.kptr_restrict=0

List all Java processes

jps -l

Run AsyncProfiler and generate flame graph

./asprof -d 400s -f ./tmp.html [PID]

Following is the original README.md file from the OpenJDK repository.

Welcome to the JDK!

For build instructions please see the online documentation, or either of these files:

See https://openjdk.org/ for more information about the OpenJDK Community and the JDK and see https://bugs.openjdk.org for JDK issue tracking.

About

COMP390 - Bring Powersort to Java.

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages

  • Java 74.6%
  • C++ 13.7%
  • C 7.2%
  • Assembly 2.8%
  • Objective-C 0.4%
  • HTML 0.3%
  • Other 1.0%