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

Feat cgo-zstd #284

Merged
merged 10 commits into from
Jul 31, 2024
Merged

Feat cgo-zstd #284

merged 10 commits into from
Jul 31, 2024

Conversation

crimson-gao
Copy link
Collaborator

No description provided.

compressor.go Outdated
"github.com/klauspost/compress/zstd"
)

var DefaultZstdCompressor LogCompressor = NewZstdCompressor(zstd.SpeedFastest)
Copy link
Collaborator

Choose a reason for hiding this comment

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

DefaultZstdCompressor,这个名称是 Default,是允许修改吗?直接是 ZstdCompressor 是不是好点

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

允许修改

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

compressLevel := 1
sls.DefaultZstdCompressor = cgozstd.NewZstdCompressor(compressLevel)

Copy link
Collaborator

Choose a reason for hiding this comment

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

DefaultZstdCompressor =》ZstdCompressor

Copy link
Collaborator

@liketic liketic Jul 30, 2024

Choose a reason for hiding this comment

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

或者,能不能搞一个函数

sls.SetZstdCgoCompressor(compressLevel int)

这样里面随便我们怎么改,只要接口在就行

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

不能直接引用,只能外挂

compressor.go Outdated
"github.com/klauspost/compress/zstd"
)

var DefaultZstdCompressor LogCompressor = NewZstdCompressor(zstd.SpeedFastest)
Copy link
Collaborator

Choose a reason for hiding this comment

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

DefaultZstdCompressor =》ZstdCompressor

@@ -0,0 +1,81 @@
## 介绍
cgo-zstd 是基于 cgo 实现的 zstd 压缩库,比纯 go 实现的 zstd 在性能上具有一定优势。
Copy link
Collaborator

Choose a reason for hiding this comment

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

我在想,能不能就搞一个 internal/zstd_cgo.go 这样一个文件。我们还有什么内容是需要放到这里的?

cgo/README.md Outdated
@@ -0,0 +1,81 @@
## 介绍
cgo-zstd 是基于 cgo 实现的 zstd 压缩库,比纯 go 实现的 zstd 在性能上具有一定优势。
下面介绍如何开启此扩展来提升 zstd 压缩的性能。
Copy link
Collaborator

Choose a reason for hiding this comment

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

1-3 行直接去掉好了

@crimson-gao crimson-gao merged commit 9a152f5 into aliyun:master Jul 31, 2024
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants