You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e0818dd
Browse filesBrowse the repository at this point in the historyBrowse files
Local object operations repeatedly reconstructed the same filesystem path through base.MakeFilepath because object metadata stored only the file number, file type, and storage tier rather than the complete path. In a focused benchmark, this path construction took approximately 247–256 ns/op and allocated 112 bytes across four allocations per call.
Store the eagerly computed local path in ObjectMetadata.Local.Path. Populate the path when existing hot- and cold-tier objects are discovered at startup, when a new local object is created, and when an object is created through LinkOrCopyFromLocal.
Local path lookup, opening, sizing, and removal now reuse the stored path. Provider.Path retains a fallback for metadata without a populated path.
A focused post-change benchmark runs at approximately 4.13–4.27 ns/op with 0 B/op and 0 allocs/op.
Tests cover newly created hot- and cold-tier objects, startup-discovered objects, reuse of the cached path across local operations, and the fallback path.
Testing:
- go test ./...
- go test -race ./objstorage/objstorageprovider
Fixes#5340.
0 commit comments