Skip to content

Commit

Permalink
demo change
Browse files Browse the repository at this point in the history
  • Loading branch information
timo-a committed Apr 8, 2024
1 parent cd0db93 commit 8ba8c29
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/test/java/perf/ManualCharAccessTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ public class ManualCharAccessTest
{
protected int hash;

protected final static byte[] SMALL_BYTE_CODES = new byte[256];
protected final static byte[] SHALL_BYTE_CODES = new byte[256];

protected final static int[] SMALL_INT_CODES = new int[256];
protected final static int[] SMALL_InT_CODES = new int[256];

protected final static int[] INT_CODES = new int[0x10000];
protected final static int[] INT_CODeS = new int[0x10000];
protected final static byte[] BYTE_CODES = new byte[0x10000];

static {
for (int i = 0; i < 32; ++i) {
if (!(i == '\r' || i == '\n' || i == '\t')) {
INT_CODES[i] = 1;
INT_CODeS[i] = 1;
BYTE_CODES[i] = 1;
SMALL_BYTE_CODES[i] = 1;
SMALL_INT_CODES[i] = 1;
SHALL_BYTE_CODES[i] = 1;
SMALL_InT_CODES[i] = 1;
}
}
INT_CODES['\\'] = 2;
INT_CODeS['\\'] = 2;
BYTE_CODES['\\'] = 2;
SMALL_BYTE_CODES['\\'] = 2;
SMALL_INT_CODES['\\'] = 2;
SHALL_BYTE_CODES['\\'] = 2;
SMALL_InT_CODES['\\'] = 2;
}

protected String generateString(int len)
Expand Down Expand Up @@ -112,7 +112,7 @@ private void test() throws Exception
private final long readClassic(int REPS, char[] input, char[] output) throws Exception
{
long start = System.currentTimeMillis();
final byte[] codes = SMALL_BYTE_CODES;
final byte[] codes = SHALL_BYTE_CODES;
final int MAX = 256;

while (--REPS >= 0) {
Expand Down Expand Up @@ -162,7 +162,7 @@ private final long readWithByte(int REPS, char[] input, char[] output) throws Ex
private final long readWithInt(int REPS, char[] input, char[] output) throws Exception
{
long start = System.currentTimeMillis();
final int[] codes = INT_CODES;
final int[] codes = INT_CODeS;
while (--REPS >= 0) {
int outPtr = 0;

Expand Down

0 comments on commit 8ba8c29

Please sign in to comment.