Skip to content

Commit

Permalink
remove unneccessary assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
merykitty committed Apr 12, 2021
1 parent a289fa8 commit 0f52a23
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,16 @@
</environmentVariables>
<arguments>
<argument>--add-modules</argument>
<argument>jdk.incubator.foreign</argument>
<argument>jdk.incubator.foreign</argument>
<argument>-Xmx8g</argument>
<argument>-Dforeign.restricted=permit</argument>
<argument>-XX:CompileThreshold=1000</argument>
<argument>-XX:+UseParallelGC</argument>
<argument>-XX:+UnlockDiagnosticVMOptions</argument>
<argument>-XX:+UnlockExperimentalVMOptions</argument>
<argument>-XX:+TrustFinalNonStaticFields</argument>
<!-- <argument>-XX:InlineFieldMaxFlatSize=0</argument>-->
<!-- <argument>-XX:FlatArrayElementMaxSize=0</argument>-->
<argument>-XX:StartFlightRecording:duration=600s,filename=profile.jfr,delay=30s,settings=strict.jfc</argument>
<argument>-ea</argument>
<argument>-p</argument>
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/io/github/merykitty/slpprocessor/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ public static void main(String[] args) throws IOException {
// var files = Files.list(DECODE_INPUT_FOLDER);
// files.filter(Files::isRegularFile)
// .forEach(path -> selfDecode(path, palettes));
System.out.println(System.getProperty("os.arch"));
decode();

long start = System.currentTimeMillis();
for (int i = 0; i < 50; i++) {
System.out.println(i);
decode();
}
long end = System.currentTimeMillis();
System.out.println(end - start);
}

private static void decode() throws IOException {
Expand All @@ -37,21 +41,17 @@ private static void decode() throws IOException {
private static void processSLPFile(Path path, PaletteContainer palettes) {
try {
var fileName = path.getFileName();
System.out.println("File name: " + fileName.toString());
System.out.println("Size: " + Files.size(path));
long start = System.currentTimeMillis();
var file = SLPFiles.decode(path, palettes);
long mid = System.currentTimeMillis();
System.out.println("Read slp file: " + (mid - start) + " ms");
file.exportGraphics(DECODE_OUTPUT_FOLDER.resolve(fileName));
long end = System.currentTimeMillis();
System.out.println("Print data: " + (end - mid) + " ms");
} catch (IOException e) {
e.printStackTrace();
// e.printStackTrace();
} catch (UnsupportedOperationException e) {
e.printStackTrace();
// e.printStackTrace();
} catch (AssertionError e) {
e.printStackTrace();
// e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private static SecFrameType commandType(int type) {
try {
throw new IllegalArgumentException("Unrecognized type: 0x" + Integer.toHexString(type));
} catch (IllegalArgumentException e) {
e.printStackTrace();
// e.printStackTrace();
}
return SecFrameType.VFX_ALPHA;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public static SecondaryFrameInfo ofNativeData(MemorySegment data, long offset) {
int height = (int)HEIGHT_HANDLE.get(data);
int hotspotX = (int)HOTSPOT_X_HANDLE.get(data);
int hotspotY = (int)HOTSPOT_Y_HANDLE.get(data);
assert(nul == 0 && propertiesLo == 0);
return new SecondaryFrameInfo(cmdTableOffset, outlineTableOffset, nul, propertiesLo, propertiesHi, frameType, width, height, hotspotX, hotspotY);
}

Expand Down

0 comments on commit 0f52a23

Please sign in to comment.