Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 13, 2025

Bumps com.alibaba.fastjson2:fastjson2 from 2.0.53 to 2.0.54.

Release notes

Sourced from com.alibaba.fastjson2:fastjson2's releases.

fastjson 2.0.54版本发布,性能进一步提升

这又是一个性能优化Bug修复的版本更新版本,大家按需升级。

1. 性能优化

这个版本的性能优化包括:

1.1 使用SWAR(SIMD Within A Register)技巧来优化序列化字符串的性能

序列化时,写字符串检测是否存在特别字符是一个性能关键点,这个版本使用SWAR(SIMD Within A Register)的技巧来做快速检测。如下

package com.alibaba.fastjson2;
class JSONWriterUTF8 {
    protected final long byteVectorQuote;
JSONWriterUTF8(Context ctx) {
// " -> 0x22, ' -> 0x27
this.byteVectorQuote = this.useSingleQuote ? 0x2727_2727_2727_2727L : 0x2222_2222_2222_2222L;
}
public void writeStringLatin1(byte[] value) {
    final long vecQuote = this.byteVectorQuote;
    int i = 0;
    final int upperBound = (value.length - i) & ~7;
    // 这里一次检测8个byte是否存在特别字符
    for (; i < upperBound; i += 8) {
        if (containsEscaped(IOUtils.getLongLittleEndian(value, i), vecQuote)) {
            break;
        }
    }
    // ...
}
static boolean containsEscaped(long v, long quote) {
/*
for (int i = 0; i < 8; ++i) {
byte c = (byte) data;
if (c == quote || c == '\' || c < ' ') {
return true;
}
data >>>= 8;
}
return false;
*/
long x22 = v ^ quote; // " -> 0x22, ' -> 0x27
long x5c = v ^ 0x5c5c5c5c5c5c5c5cL;
x22 = (x22 - 0x0101010101010101L) & ~x22;
x5c = (x5c - 0x0101010101010101L) & ~x5c;

return ((x22 | x5c | (0x7F7F_7F7F_7F7F_7F7FL - v + 0x1010_1010_1010_1010L) | v) & 0x8080808080808080L) != 0;

}

}
</tr></table>

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jan 13, 2025
@github-actions github-actions bot enabled auto-merge January 13, 2025 06:00
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • annotation-error-decoder/pom.xml
    • lines 49-48
  • apt-test-generator/pom.xml
    • lines 62-61
  • benchmark/pom.xml
    • lines 70-69
  • core/pom.xml
    • lines 37-36
  • googlehttpclient/pom.xml
    • lines 54-53
  • hc5/pom.xml
    • lines 67-66
  • httpclient/pom.xml
    • lines 75-74
  • hystrix/pom.xml
    • lines 78-77
  • jackson-jaxb/pom.xml
    • lines 82-83
  • java11/pom.xml
    • lines 50-49
  • jaxb-jakarta/pom.xml
    • lines 55-57
  • jaxb/pom.xml
    • lines 45-49
  • jaxrs2/pom.xml
    • lines 103-102
  • jaxrs3/pom.xml
    • lines 89-88
  • jaxrs4/pom.xml
    • lines 83-82
  • kotlin/pom.xml
    • lines 71-70
  • okhttp/pom.xml
    • lines 59-58
  • pom.xml
    • lines 579-580
  • reactive/pom.xml
    • lines 98-97
  • ribbon/pom.xml
    • lines 83-82
  • soap-jakarta/pom.xml
    • lines 63-62
    • lines 79-81
  • soap/pom.xml
    • lines 55-60
    • lines 70-71

Bumps [com.alibaba.fastjson2:fastjson2](https://github.com/alibaba/fastjson2) from 2.0.53 to 2.0.54.
- [Release notes](https://github.com/alibaba/fastjson2/releases)
- [Commits](alibaba/fastjson2@2.0.53...2.0.54)

---
updated-dependencies:
- dependency-name: com.alibaba.fastjson2:fastjson2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/maven/com.alibaba.fastjson2-fastjson2-2.0.54 branch from 3764d8f to 5d471cd Compare January 13, 2025 06:09
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • annotation-error-decoder/pom.xml
    • lines 49-48
  • apt-test-generator/pom.xml
    • lines 62-61
  • benchmark/pom.xml
    • lines 70-69
  • core/pom.xml
    • lines 37-36
  • googlehttpclient/pom.xml
    • lines 54-53
  • hc5/pom.xml
    • lines 67-66
  • httpclient/pom.xml
    • lines 75-74
  • hystrix/pom.xml
    • lines 78-77
  • jackson-jaxb/pom.xml
    • lines 82-83
  • java11/pom.xml
    • lines 50-49
  • jaxb-jakarta/pom.xml
    • lines 55-57
  • jaxb/pom.xml
    • lines 45-49
  • jaxrs2/pom.xml
    • lines 103-102
  • jaxrs3/pom.xml
    • lines 89-88
  • jaxrs4/pom.xml
    • lines 83-82
  • kotlin/pom.xml
    • lines 71-70
  • okhttp/pom.xml
    • lines 59-58
  • pom.xml
    • lines 579-580
  • reactive/pom.xml
    • lines 98-97
  • ribbon/pom.xml
    • lines 83-82
  • soap-jakarta/pom.xml
    • lines 63-62
    • lines 79-81
  • soap/pom.xml
    • lines 55-60
    • lines 70-71

@github-actions github-actions bot merged commit b23a79a into master Jan 13, 2025
7 checks passed
@github-actions github-actions bot deleted the dependabot/maven/com.alibaba.fastjson2-fastjson2-2.0.54 branch January 13, 2025 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants