[PR #101] [MERGED] Optimized function "bool directory_empty()" #1344

Closed
opened 2026-03-04 01:53:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/101
Author: @adobos
Created: 12/24/2014
Status: Merged
Merged: 1/13/2015
Merged by: @ggtakec

Base: masterHead: directory_empty_optimization


📝 Commits (1)

  • 69ef7fb Optimized function directory_empty: check for at most one entry when evaluating whether a directory is empty or not (as opposed to doing full directory listing)

📊 Changes

1 file changed (+11 additions, -4 deletions)

View changed files

📝 src/s3fs.cpp (+11 -4)

📄 Description

Function "bool directory_empty()" downloads full directory listing to find out whether the directory is empty or not. This requires both a larger download from S3, and possibly multiple round trips to S3 (S3 API returns at most 1,000 entries per call). For directories with many thousands of entries, this comes with a significant performance penalty.

The modified version of the function checks for at most one entry to make a decision whether the directory is empty or not.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/101 **Author:** [@adobos](https://github.com/adobos) **Created:** 12/24/2014 **Status:** ✅ Merged **Merged:** 1/13/2015 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `directory_empty_optimization` --- ### 📝 Commits (1) - [`69ef7fb`](https://github.com/s3fs-fuse/s3fs-fuse/commit/69ef7fbefbeafebf7a303594c51ceb3011c170fb) Optimized function directory_empty: check for at most one entry when evaluating whether a directory is empty or not (as opposed to doing full directory listing) ### 📊 Changes **1 file changed** (+11 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs.cpp` (+11 -4) </details> ### 📄 Description Function "bool directory_empty()" downloads full directory listing to find out whether the directory is empty or not. This requires both a larger download from S3, and possibly multiple round trips to S3 (S3 API returns at most 1,000 entries per call). For directories with many thousands of entries, this comes with a significant performance penalty. The modified version of the function checks for at most one entry to make a decision whether the directory is empty or not. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:53:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1344
No description provided.