-
Notifications
You must be signed in to change notification settings - Fork 487
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
Optimize performance for S3Escaper.encode #1528
Comments
I wonder how this method affects overall performance including network/disk I/O. Please share your sample code here. |
I'm using final GetPresignedObjectUrlArgs.Builder builder =
GetPresignedObjectUrlArgs.builder();
if (StringUtils.isNotEmpty(file.getRegionName())) {
builder.region(file.getRegionName());
}
builder.bucket(file.getBucketName());
builder.object(file.getObjectPath());
if (StringUtils.isNotEmpty(file.getFileName())) {
builder.extraQueryParams(Collections.singletonMap(
"response-content-disposition",
contentDisposition(file.getFileName(), attachment).toString()
));
}
final GetPresignedObjectUrlArgs args = builder
.method(Method.GET)
.expiry(Math.toIntExact(expireAfter.toMillis() / 1000))
.build();
return client.getPresignedObjectUrl(args); |
Make sense. Please send a PR. |
kzhsw
added a commit
to kzhsw/minio-java
that referenced
this issue
Feb 3, 2024
Replace `String.replaceAll` with StringBuilder for better performance. See also benchmark at <https://github.com/kzhsw/minio-java-jmh>. Close minio#1528
It's here: #1529 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm building some minio-based java app, and found out
S3Escaper.encode
and theString.replaceAll
call inside it is one of the bottlenecks of the whole app after some profiling.The optimized code is here.
The JMH benchmark result on github actions ci is here
The text was updated successfully, but these errors were encountered: