[PR #1554] [MERGED] Use clock_gettime instead of gettimeofday #2042

Closed
opened 2026-03-04 02:03:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/1554
Author: @ggtakec
Created: 2/7/2021
Status: Merged
Merged: 2/8/2021
Merged by: @gaul

Base: masterHead: use_clock_gettime


📝 Commits (1)

  • 6302db5 Use clock_gettime instead of gettimeofday

📊 Changes

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

View changed files

📝 src/s3fs_logger.h (+16 -4)

📄 Description

Relevant Issue (if applicable)

#1540

Details

Using gettimeofday for log output will reduce performance.
It will be especially clear when the debug level produces a lot of output, such as INFO.
Instead, call clock_gettime with CLOCK_MONOTONIC_COARSE.
In some cases such as OSX, CLOCK_MONOTONIC_COARSE is not supported. In that case, use CLOCK_MONOTONIC.


🔄 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/1554 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 2/7/2021 **Status:** ✅ Merged **Merged:** 2/8/2021 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `use_clock_gettime` --- ### 📝 Commits (1) - [`6302db5`](https://github.com/s3fs-fuse/s3fs-fuse/commit/6302db5799cf1e868b27176425a3cbfdc191cfa2) Use clock_gettime instead of gettimeofday ### 📊 Changes **1 file changed** (+16 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs_logger.h` (+16 -4) </details> ### 📄 Description ### Relevant Issue (if applicable) #1540 ### Details Using gettimeofday for log output will reduce performance. It will be especially clear when the debug level produces a lot of output, such as INFO. Instead, call clock_gettime with CLOCK_MONOTONIC_COARSE. In some cases such as OSX, CLOCK_MONOTONIC_COARSE is not supported. In that case, use CLOCK_MONOTONIC. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:03:24 +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#2042
No description provided.