| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ed13810 commit b6cab55
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ jobs: | |||
| 8 | 8 | ||
| 9 | 9 | strategy: | |
| 10 | 10 | matrix: | |
| 11 | - version: [ 18, 19, 20, 21, 22, 23 ] | ||
| 11 | + version: [ 24 ] | ||
| 12 | 12 | vector-length: [ 256, 512 ] | |
| 13 | 13 | ||
| 14 | 14 | steps: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,11 +17,11 @@ jobs: | |||
| 17 | 17 | ||
| 18 | 18 | - uses: gradle/actions/wrapper-validation@v3 | |
| 19 | 19 | ||
| 20 | - - name: Set up JDK 18 | ||
| 20 | + - name: Set up JDK 24 | ||
| 21 | 21 | uses: actions/setup-java@v4 | |
| 22 | 22 | with: | |
| 23 | 23 | distribution: temurin | |
| 24 | - java-version: 18 | ||
| 24 | + java-version: 24 | ||
| 25 | 25 | ||
| 26 | 26 | - name: Setup Gradle | |
| 27 | 27 | uses: gradle/actions/setup-gradle@v3 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,7 +73,7 @@ Please remember about specifying the desired version. | |||
| 73 | 73 | Note that simdjson-java follows the [SemVer specification](https://semver.org/), which means, for example, that a major | |
| 74 | 74 | version of zero indicates initial development, so the library's API should not be considered stable. | |
| 75 | 75 | ||
| 76 | - We require Java 18 or better. | ||
| 76 | + We require Java 24 or better. | ||
| 77 | 77 | ||
| 78 | 78 | ## Benchmarks | |
| 79 | 79 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,9 +33,9 @@ java { | |||
| 33 | 33 | // It seems that specifying the minimum supported Java version while allowing the use of newer | |
| 34 | 34 | // ones isn't possible in Gradle. To test the library against multiple Java versions, the | |
| 35 | 35 | // workaround proposed in https://github.com/gradle/gradle/issues/16256 has been applied: | |
| 36 | - if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_18)) { | ||
| 36 | + if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) { | ||
| 37 | 37 | toolchain { | |
| 38 | - languageVersion = JavaLanguageVersion.of(18) | ||
| 38 | + languageVersion = JavaLanguageVersion.of(24) | ||
| 39 | 39 | } | |
| 40 | 40 | } | |
| 41 | 41 | withJavadocJar() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | distributionBase=GRADLE_USER_HOME | |
| 2 | 2 | distributionPath=wrapper/dists | |
| 3 | - distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip | ||
| 3 | + distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip | ||
| 4 | 4 | networkTimeout=10000 | |
| 5 | 5 | validateDistributionUrl=true | |
| 6 | 6 | zipStoreBase=GRADLE_USER_HOME | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | import static jdk.incubator.vector.ByteVector.SPECIES_256; | |
| 9 | 9 | import static jdk.incubator.vector.ByteVector.SPECIES_512; | |
| 10 | - import static jdk.incubator.vector.VectorOperators.UNSIGNED_LE; | ||
| 10 | + import static jdk.incubator.vector.VectorOperators.ULE; | ||
| 11 | 11 | ||
| 12 | 12 | class StructuralIndexer { | |
| 13 | 13 | ||
@@ -88,8 +88,8 @@ private void index256(byte[] buffer, int length) { | |||
| 88 | 88 | escaped = (EVEN_BITS_MASK ^ invertMask) & followsEscape; | |
| 89 | 89 | } | |
| 90 | 90 | ||
| 91 | - long unescaped0 = chunk0.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 92 | - long unescaped1 = chunk1.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 91 | + long unescaped0 = chunk0.compare(ULE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 92 | + long unescaped1 = chunk1.compare(ULE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 93 | 93 | long unescaped = unescaped0 | (unescaped1 << 32); | |
| 94 | 94 | ||
| 95 | 95 | long quote0 = chunk0.eq(QUOTE).toLong(); | |
@@ -148,8 +148,8 @@ private void index256(byte[] buffer, int length) { | |||
| 148 | 148 | escaped = (EVEN_BITS_MASK ^ invertMask) & followsEscape; | |
| 149 | 149 | } | |
| 150 | 150 | ||
| 151 | - long unescaped0 = chunk0.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 152 | - long unescaped1 = chunk1.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 151 | + long unescaped0 = chunk0.compare(ULE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 152 | + long unescaped1 = chunk1.compare(ULE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 153 | 153 | long unescaped = unescaped0 | (unescaped1 << 32); | |
| 154 | 154 | ||
| 155 | 155 | long quote0 = chunk0.eq(QUOTE).toLong(); | |
@@ -228,7 +228,7 @@ private void index512(byte[] buffer, int length) { | |||
| 228 | 228 | escaped = (EVEN_BITS_MASK ^ invertMask) & followsEscape; | |
| 229 | 229 | } | |
| 230 | 230 | ||
| 231 | - long unescaped = chunk.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 231 | + long unescaped = chunk.compare(ULE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 232 | 232 | long quote = chunk.eq(QUOTE).toLong() & ~escaped; | |
| 233 | 233 | long inString = prefixXor(quote) ^ prevInString; | |
| 234 | 234 | prevInString = inString >> 63; | |
@@ -271,7 +271,7 @@ private void index512(byte[] buffer, int length) { | |||
| 271 | 271 | escaped = (EVEN_BITS_MASK ^ invertMask) & followsEscape; | |
| 272 | 272 | } | |
| 273 | 273 | ||
| 274 | - long unescaped = chunk.compare(UNSIGNED_LE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 274 | + long unescaped = chunk.compare(ULE, LAST_CONTROL_CHARACTER).toLong(); | ||
| 275 | 275 | long quote = chunk.eq(QUOTE).toLong() & ~escaped; | |
| 276 | 276 | long inString = prefixXor(quote) ^ prevInString; | |
| 277 | 277 | prevInString = inString >> 63; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,8 +11,8 @@ | |||
| 11 | 11 | import static jdk.incubator.vector.VectorOperators.LSHL; | |
| 12 | 12 | import static jdk.incubator.vector.VectorOperators.LSHR; | |
| 13 | 13 | import static jdk.incubator.vector.VectorOperators.NE; | |
| 14 | - import static jdk.incubator.vector.VectorOperators.UNSIGNED_GE; | ||
| 15 | - import static jdk.incubator.vector.VectorOperators.UNSIGNED_GT; | ||
| 14 | + import static jdk.incubator.vector.VectorOperators.UGE; | ||
| 15 | + import static jdk.incubator.vector.VectorOperators.UGT; | ||
| 16 | 16 | import static jdk.incubator.vector.VectorShuffle.iota; | |
| 17 | 17 | import static org.simdjson.VectorUtils.BYTE_SPECIES; | |
| 18 | 18 | import static org.simdjson.VectorUtils.INT_SPECIES; | |
@@ -65,7 +65,7 @@ static void validate(byte[] buffer, int length) { | |||
| 65 | 65 | if (chunk.and(ALL_ASCII_MASK).compare(EQ, 0).allTrue()) { | |
| 66 | 66 | errors |= previousIncomplete; | |
| 67 | 67 | } else { | |
| 68 | - previousIncomplete = chunk.compare(UNSIGNED_GE, INCOMPLETE_CHECK).toLong(); | ||
| 68 | + previousIncomplete = chunk.compare(UGE, INCOMPLETE_CHECK).toLong(); | ||
| 69 | 69 | // Shift the input forward by four bytes to make space for the previous four bytes. | |
| 70 | 70 | // The previous three bytes are required for validation, pulling in the last integer | |
| 71 | 71 | // will give the previous four bytes. The switch to integer vectors is to allow for | |
@@ -97,13 +97,13 @@ static void validate(byte[] buffer, int length) { | |||
| 97 | 97 | .or(chunkWithPreviousFourBytes.lanewise(LSHR, TWO_BYTES_SIZE)) | |
| 98 | 98 | .reinterpretAsBytes(); | |
| 99 | 99 | // The minimum leading byte of 3-byte sequences is always greater than the maximum leading byte of 2-byte sequences. | |
| 100 | - VectorMask<Byte> is3ByteLead = previousTwoBytes.compare(UNSIGNED_GT, MAX_2_LEADING_BYTE); | ||
| 100 | + VectorMask<Byte> is3ByteLead = previousTwoBytes.compare(UGT, MAX_2_LEADING_BYTE); | ||
| 101 | 101 | ByteVector previousThreeBytes = chunkAsInts | |
| 102 | 102 | .lanewise(LSHL, THREE_BYTES_SIZE) | |
| 103 | 103 | .or(chunkWithPreviousFourBytes.lanewise(LSHR, Byte.SIZE)) | |
| 104 | 104 | .reinterpretAsBytes(); | |
| 105 | 105 | // The minimum leading byte of 4-byte sequences is always greater than the maximum leading byte of 3-byte sequences. | |
| 106 | - VectorMask<Byte> is4ByteLead = previousThreeBytes.compare(UNSIGNED_GT, MAX_3_LEADING_BYTE); | ||
| 106 | + VectorMask<Byte> is4ByteLead = previousThreeBytes.compare(UGT, MAX_3_LEADING_BYTE); | ||
| 107 | 107 | // The firstCheck vector contains 0x80 values on continuation byte indexes. | |
| 108 | 108 | // The leading bytes of 3 and 4-byte sequences should match up with these indexes and zero them out. | |
| 109 | 109 | ByteVector secondCheck = firstCheck.add((byte) 0x80, is3ByteLead.or(is4ByteLead)); | |
@@ -117,7 +117,7 @@ static void validate(byte[] buffer, int length) { | |||
| 117 | 117 | ByteVector chunk = ByteVector.fromArray(BYTE_SPECIES, buffer, offset, remainingBytes); | |
| 118 | 118 | if (!chunk.and(ALL_ASCII_MASK).compare(EQ, 0).allTrue()) { | |
| 119 | 119 | IntVector chunkAsInts = chunk.reinterpretAsInts(); | |
| 120 | - previousIncomplete = chunk.compare(UNSIGNED_GE, INCOMPLETE_CHECK).toLong(); | ||
| 120 | + previousIncomplete = chunk.compare(UGE, INCOMPLETE_CHECK).toLong(); | ||
| 121 | 121 | // Shift the input forward by four bytes to make space for the previous four bytes. | |
| 122 | 122 | // The previous three bytes are required for validation, pulling in the last integer | |
| 123 | 123 | // will give the previous four bytes. The switch to integer vectors is to allow for | |
@@ -149,13 +149,13 @@ static void validate(byte[] buffer, int length) { | |||
| 149 | 149 | .or(chunkWithPreviousFourBytes.lanewise(LSHR, TWO_BYTES_SIZE)) | |
| 150 | 150 | .reinterpretAsBytes(); | |
| 151 | 151 | // The minimum leading byte of 3-byte sequences is always greater than the maximum leading byte of 2-byte sequences. | |
| 152 | - VectorMask<Byte> is3ByteLead = previousTwoBytes.compare(UNSIGNED_GT, MAX_2_LEADING_BYTE); | ||
| 152 | + VectorMask<Byte> is3ByteLead = previousTwoBytes.compare(UGT, MAX_2_LEADING_BYTE); | ||
| 153 | 153 | ByteVector previousThreeBytes = chunkAsInts | |
| 154 | 154 | .lanewise(LSHL, THREE_BYTES_SIZE) | |
| 155 | 155 | .or(chunkWithPreviousFourBytes.lanewise(LSHR, Byte.SIZE)) | |
| 156 | 156 | .reinterpretAsBytes(); | |
| 157 | 157 | // The minimum leading byte of 4-byte sequences is always greater than the maximum leading byte of 3-byte sequences. | |
| 158 | - VectorMask<Byte> is4ByteLead = previousThreeBytes.compare(UNSIGNED_GT, MAX_3_LEADING_BYTE); | ||
| 158 | + VectorMask<Byte> is4ByteLead = previousThreeBytes.compare(UGT, MAX_3_LEADING_BYTE); | ||
| 159 | 159 | // The firstCheck vector contains 0x80 values on continuation byte indexes. | |
| 160 | 160 | // The leading bytes of 3 and 4-byte sequences should match up with these indexes and zero them out. | |
| 161 | 161 | ByteVector secondCheck = firstCheck.add((byte) 0x80, is3ByteLead.or(is4ByteLead)); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments