[PR #8061] [CLOSED] Refactor fixBlobs to use WalkDir for efficiency instead of Walk #59306

Closed
opened 2026-04-29 14:15:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/8061
Author: @Vkanhan
Created: 12/12/2024
Status: Closed

Base: mainHead: perf/refactor-fixblobs-walkdir


📝 Commits (4)

  • a693a07 server: refactor fixBlobs to use WalkDir for efficiency
  • 3ec6550 server: refactor fixBlobs to use WalkDir for efficiency
  • 12236fd server: refactor fixBlobs to use WalkDir for efficiency
  • 37a8c3a server: refactor fixBlobs to use WalkDir for efficiency

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 server/fixblobs.go (+7 -1)

📄 Description

filepath.Walk calls os.Lstat for every file or directory to retrieve os.FileInfo, which can be slower.

filepath.WalkDir avoids unnecessary system calls since it provides a fs.DirEntry, which includes file type information without requiring a stat call.


🔄 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/ollama/ollama/pull/8061 **Author:** [@Vkanhan](https://github.com/Vkanhan) **Created:** 12/12/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `perf/refactor-fixblobs-walkdir` --- ### 📝 Commits (4) - [`a693a07`](https://github.com/ollama/ollama/commit/a693a07a366de37d1016997e765cfdb0843d584f) server: refactor fixBlobs to use WalkDir for efficiency - [`3ec6550`](https://github.com/ollama/ollama/commit/3ec6550bdf01c1e4db993b3f91294090220e67c5) server: refactor fixBlobs to use WalkDir for efficiency - [`12236fd`](https://github.com/ollama/ollama/commit/12236fdcb568e9a4d77bbcd4971b2e365dbbc33e) server: refactor fixBlobs to use WalkDir for efficiency - [`37a8c3a`](https://github.com/ollama/ollama/commit/37a8c3a0ce072f2f8fdb174deb9fb7f824b2e2dd) server: refactor fixBlobs to use WalkDir for efficiency ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/fixblobs.go` (+7 -1) </details> ### 📄 Description filepath.Walk calls os.Lstat for every file or directory to retrieve os.FileInfo, which can be slower. filepath.WalkDir avoids unnecessary system calls since it provides a fs.DirEntry, which includes file type information without requiring a stat call. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 14:15:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#59306