Skip to content

Commit

Permalink
Update Gradle & Java to support Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBigSasha committed Oct 13, 2022
1 parent 03fd431 commit 058f5eb
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 45 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/Runtime_Efficiency_Tester_COMP250_Fall2020.iml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
id 'org.beryx.jlink' version '2.12.0'
id 'org.openjfx.javafxplugin' version '0.0.13'
id 'org.beryx.jlink' version '2.25.0'
id 'java'
id "com.github.johnrengelman.shadow" version "6.1.0"
id "com.github.johnrengelman.shadow" version "7.1.2"
id("maven-publish")
}

group 'ca.sashaphoto'
version '1.2'
version '1.4'

repositories {
mavenCentral()
}

javafx {
version = "15"
version = "17"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.reflections', name: 'reflections', version: '0.9.5-RC2'}
implementation group: 'org.reflections', name: 'reflections', version: '0.10.2'
}

sourceSets {
main {
Expand All @@ -47,4 +47,4 @@ shadowJar {
archiveBaseName.set('RuntimeTester')
archiveClassifier.set('')
archiveVersion.set('')
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Thu Oct 15 17:13:44 EDT 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface benchmark {
public @interface Benchmark {
String name();

String category() default "Other";
Expand All @@ -18,4 +18,4 @@

boolean theoretical() default false;

}
}
14 changes: 7 additions & 7 deletions src/main/java/RuntimeTester/BenchmarkDefinitions.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static Date nextDate(){
return null;
}

@benchmark(name = "ArrayList.sort", expectedEfficiency = "O(n log(n))", category = "Java Builtin")
@Benchmark(name = "ArrayList.sort", expectedEfficiency = "O(n log(n))", category = "Java Builtin")
public static long arraysSort(long size) {
ArrayList<Date> dataset = new ArrayList<>();
for (long i = 0; i < size; i++) {
Expand All @@ -122,23 +122,23 @@ public static long arraysSort(long size) {
return endTime - startTime;
}

@benchmark(name = "traverse list", category = "Math demos", expectedEfficiency = "O(N)", theoretical = true)
@Benchmark(name = "traverse list", category = "Math demos", expectedEfficiency = "O(N)", theoretical = true)
public Long n(Long size) {
//System.out.println("Invoked benchmark for size " + size);
return size * getSimulationSpeed();
}

@benchmark(name = "sort", expectedEfficiency = "o(n^2)", category = "Math demos", theoretical = true)
@Benchmark(name = "sort", expectedEfficiency = "o(n^2)", category = "Math demos", theoretical = true)
public Long nSquared(Long size) {
return Math.round(Math.pow(size , 2) * getSimulationSpeed());
}

@benchmark(name = "fast sorting ", category = "Math demos", expectedEfficiency = "o(n log(n))", description = "This is the speed at which many optimal sorting algorithms run", theoretical = true)
@Benchmark(name = "fast sorting ", category = "Math demos", expectedEfficiency = "o(n log(n))", description = "This is the speed at which many optimal sorting algorithms run", theoretical = true)
public long nLogN(long size) {
return (long) (size * Math.log(size)) * getSimulationSpeed();
}

@benchmark(name = "superfast", description = " this one is sanic fast", expectedEfficiency = "O(1)", category = "Math demos", theoretical = true)
@Benchmark(name = "superfast", description = " this one is sanic fast", expectedEfficiency = "O(1)", category = "Math demos", theoretical = true)
public long one(long size) {
return getSimulationSpeed();
}
Expand All @@ -153,7 +153,7 @@ public static long nFactorial(long size){
return factorial;
}*/ //This breaks the graph by exploding to massive size

@benchmark(name = "queue.deqeue", expectedEfficiency = "O(1)", category = "Java Builtin")
@Benchmark(name = "queue.deqeue", expectedEfficiency = "O(1)", category = "Java Builtin")
public long enqueueTest(long size) {
Queue<Date> dataset = new ConcurrentLinkedQueue<>();
for (long i = 0; i < size; i++) {
Expand All @@ -165,7 +165,7 @@ public long enqueueTest(long size) {
return endTime - startTime;
}

@benchmark(name = "queue.get from middle", expectedEfficiency = "O(N)", category = "Java Builtin")
@Benchmark(name = "queue.get from middle", expectedEfficiency = "O(N)", category = "Java Builtin")
public long getFromMiddleOfQueue(long size){
Queue<Date> dataset = new ConcurrentLinkedQueue<>();
for(long i = 0; i < size; i++){
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/RuntimeTester/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ private void reflexiveGetBenchmarkables(Class<?> c) throws InstantiationExceptio
Annotation[] annotations = m.getAnnotations();
if (annotations.length == 0) continue;
for (Annotation a : annotations) {
if (a instanceof benchmark) {
benchmark bm = (benchmark) a;
if (a instanceof Benchmark) {
Benchmark bm = (Benchmark) a;
BenchmarkItem item = new BenchmarkItem(m, bm);
if(!customBenchmarks.containsValue(item)) customBenchmarks.put(item.getCheckbox().getText(), item);
}
Expand Down Expand Up @@ -519,7 +519,7 @@ public boolean isTheoretical() {
private String name;
private String description;

public BenchmarkItem(Method m, benchmark a) throws IllegalArgumentException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
public BenchmarkItem(Method m, Benchmark a) throws IllegalArgumentException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
name = a.name();
description = a.category();
expectedRuntime = a.expectedEfficiency();
Expand Down

0 comments on commit 058f5eb

Please sign in to comment.