-
Notifications
You must be signed in to change notification settings - Fork 113
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
Feat cgo-zstd #284
Conversation
compressor.go
Outdated
"github.com/klauspost/compress/zstd" | ||
) | ||
|
||
var DefaultZstdCompressor LogCompressor = NewZstdCompressor(zstd.SpeedFastest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DefaultZstdCompressor,这个名称是 Default,是允许修改吗?直接是 ZstdCompressor 是不是好点
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
允许修改
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DefaultZstdCompressor =》ZstdCompressor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
或者,能不能搞一个函数
sls.SetZstdCgoCompressor(compressLevel int)
这样里面随便我们怎么改,只要接口在就行
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DefaultZstdCompressor =》ZstdCompressor
extensions/cgo-zstd/README.md
Outdated
@@ -0,0 +1,81 @@ | |||
## 介绍 | |||
cgo-zstd 是基于 cgo 实现的 zstd 压缩库,比纯 go 实现的 zstd 在性能上具有一定优势。 |
There was a problem hiding this comment.
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 压缩的性能。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1-3 行直接去掉好了
No description provided.