Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getObject 更新CRC64的值,导致CPU升高 #450

Open
dragonTalon opened this issue Jan 4, 2023 · 0 comments
Open

getObject 更新CRC64的值,导致CPU升高 #450

dragonTalon opened this issue Jan 4, 2023 · 0 comments

Comments

@dragonTalon
Copy link

dragonTalon commented Jan 4, 2023

方法:com.aliyun.oss.internal.OSSObjectOperation#getObject(com.aliyun.oss.model.GetObjectRequest)
在OSSObject对象的时候加入了CRC64方法,导致每次reader的时候回去出发CRC64的update
`

  CRC64 crc = new CRC64();

  CheckedInputStream checkedInputstream = new CheckedInputStream(progressInputStream, crc);

  ossObject.setObjectContent(checkedInputstream);

`
读取的时候CheckedInputStream 都会调用cksum.update(b);

`

    public int read() throws IOException {

    int b = in.read();

    if (b != -1) {

        cksum.update(b);

    }

    return b;

}

`

`

    public int read(byte[] buf, int off, int len) throws IOException {

    len = in.read(buf, off, len);

    if (len != -1) {

        cksum.update(buf, off, len);

    }

    return len;

}

`
导致read读取文件时候CPU比不加CRC64的时候高百分之三十.

这里是不是存在问题???

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant