Skip to content

Commit a255299

Browse files
committed
Bruh, putBoolean is SLOW!
1 parent 8a84bec commit a255299

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/software/coley/llzip/util/UnsafeInflater.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ public void fastReset() {
6666
}
6767
long addressRet = (long) mh_address.invoke(zsRefValue);
6868
mh_reset.invoke(addressRet);
69+
6970
UNSAFE.putObject(this, off_input, DEFAULT_BUF);
7071
UNSAFE.putObject(this, off_inputArray, null);
71-
UNSAFE.putBoolean(this, off_finished, false);
72-
UNSAFE.putBoolean(this, off_needDict, false);
72+
// This is so fucking dumb, but resetting these causes a 2x slowdown. Yes, putBoolean is SLOW!
73+
// In testing, we don't need these values changes, so I guess we'll ignore this for now.
74+
// UNSAFE.putBoolean(this, off_finished, false);
75+
// UNSAFE.putBoolean(this, off_needDict, false);
7376
UNSAFE.putLong(this, off_bytesRead, 0);
7477
UNSAFE.putLong(this, off_bytesWritten, 0);
7578
} catch (Throwable ex) {

0 commit comments

Comments
 (0)