apache / opendal

Apache OpenDAL: One Layer, All Storage.
https://opendal.apache.org
Apache License 2.0
3.46k stars 486 forks source link

feat(core): Implement write if not exists for azblob,azdls,gcs,oss,cos #5321

Closed Xuanwo closed 1 week ago

Xuanwo commented 1 week ago

Signed-off-by: Xuanwo github@xuanwo.io

Which issue does this PR close?

Closes https://github.com/apache/opendal/issues/5218

Rationale for this change

None.

What changes are included in this PR?

Implement condition write for all supported storage services.

Are there any user-facing changes?

codspeed-hq[bot] commented 1 week ago

CodSpeed Performance Report

Merging #5321 will degrade performances by 18.88%

Comparing add-write-if-not-exists (f8152be) with main (4dc0f15)

Summary

❌ 8 regressions ✅ 65 untouched benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main add-write-if-not-exists Change
buffer 256 KiB * 32 chunk 154.4 ns 183.6 ns -15.89%
buffer 256 KiB * 4 chunk 125.3 ns 154.4 ns -18.88%
buffer 4.00 MiB * 32 chunk 125.3 ns 154.4 ns -18.88%
buffer 4.00 MiB * 4 chunk 125.3 ns 154.4 ns -18.88%
256 KiB * 1000k truncate 245.8 ns 275 ns -10.61%
256 KiB * 100k truncate 245.8 ns 275 ns -10.61%
256 KiB * 10k truncate 245.8 ns 275 ns -10.61%
256 KiB * 1k truncate 245.8 ns 275 ns -10.61%
Xuanwo commented 1 week ago

Thank you @ClSlaid for the review!