[PR #14893] [CLOSED] manifest: hoist BlobsPath regex to package level #61599

Closed
opened 2026-04-29 16:40:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14893
Author: @TimRots
Created: 3/17/2026
Status: Closed

Base: mainHead: manifest-hoist-blobspath-regex


📝 Commits (1)

  • 656b6c7 manifest: hoist BlobsPath regex to package level

📊 Changes

1 file changed (+3 additions, -5 deletions)

View changed files

📝 manifest/paths.go (+3 -5)

📄 Description

Summary

  • Hoist SHA-256 digest validation regex from per-call regexp.MustCompile inside BlobsPath to a package-level var blobDigestPattern
  • Eliminates ~2,5μs of regex compilation (parse + NFA construction) on every blob resolution call
  • Compiled *regexp.Regexp is concurrency-safe for MatchString, no synchronization needed

Test plan

  • go vet ./manifest/
  • go test ./manifest/

🔄 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/14893 **Author:** [@TimRots](https://github.com/TimRots) **Created:** 3/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `manifest-hoist-blobspath-regex` --- ### 📝 Commits (1) - [`656b6c7`](https://github.com/ollama/ollama/commit/656b6c73b5b7e7a53cb850175f4ebd45a4f3973c) manifest: hoist BlobsPath regex to package level ### 📊 Changes **1 file changed** (+3 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `manifest/paths.go` (+3 -5) </details> ### 📄 Description ## Summary - Hoist SHA-256 digest validation regex from per-call `regexp.MustCompile` inside `BlobsPath` to a package-level `var blobDigestPattern` - Eliminates ~2,5μs of regex compilation (parse + NFA construction) on every blob resolution call - Compiled `*regexp.Regexp` is concurrency-safe for `MatchString`, no synchronization needed ## Test plan - [x] `go vet ./manifest/` - [x] `go test ./manifest/` --- <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 16:40:12 -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#61599