Skip to content

git.rb: Fast exit from update_cache if repo not changed since cached - #3895

Open
zaits07 wants to merge 1 commit into
ytti:masterfrom
zaits07:zaits07-patch-1
Open

git.rb: Fast exit from update_cache if repo not changed since cached#3895
zaits07 wants to merge 1 commit into
ytti:masterfrom
zaits07:zaits07-patch-1

Conversation

@zaits07

@zaits07 zaits07 commented Aug 25, 2026

Copy link
Copy Markdown

Pre-Request Checklist

  • Passes rubocop code analysis (try rubocop --auto-correct)
  • Tests added or adapted (try rake test)
  • Changes are reflected in the documentation
  • User-visible changes appended to CHANGELOG.md

Description

Fast exit from update_cache if repo not changed since cached.

I need last change date in oxidized-web node list. I patched oxidize-web and see last change date in node list according to last version from git repo date. But my list of 200 nodes refreshes by 30 sec.
I found that almost time spent in git.update_cache. Specifically in code
walker = Rugged::Walker.new(repo)
walker.sorting(Rugged::SORT_DATE)
walker.push(repo.head.target.oid)
take 150 ms.
And it called on every node, regardless that i have only one repo and it cached after first node.
200 nodes * 150 ms = 30 sec

Related to pr yttimiz/oxidized-web#461

Fast exit from update_cache if repo not changed since cached.

I need last change date in oxidized-web node list.
I patched oxidize-web and see last change date in node list according to last version from git repo date.
But my list of 200 nodes refreshes by 30 sec.
I found that almost time spent in git.update_cache.
Specifically in code
`        walker = Rugged::Walker.new(repo)
        walker.sorting(Rugged::SORT_DATE)
        walker.push(repo.head.target.oid)`
And it called on every node, regardless that i have only one repo and it cached after first node.
@zaits07 zaits07 changed the title Update git.rb git.rb: Fast exit from update_cache if repo not changed since cached Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant