Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Prints the profile report

AuthorDave Jarvis <email>
Date2026-02-09 22:04:23 GMT-0800
Commitc4c5f11033125d3066eb5d1b4ec441c822226b35
Parentd191cfc
Git.php
$elapsed = microtime( true ) - $this->pTimers[$name];
+ // Initialize stat entry if missing
if( !isset( $this->pStats[$name] ) ) {
$this->pStats[$name] = ['cnt' => 0, 'time' => 0.0];
public function profileReport(): string {
+ if (empty($this->pStats)) {
+ return "\n\n";
+ }
+
+ // Sort by total time descending
uasort( $this->pStats, fn($a, $b) => $b['time'] <=> $a['time'] );
- $out = "";
+ $out = "\n\n";
return $out;
}
- // --- Core Methods ---
+ // --- Core Methods (Instrumented) ---
public function setRepository($repoPath) {
private function readDeltaTargetSize( $fileHandle, int $type, string $buffer, int $pos ): int {
+ $this->enter( __METHOD__ );
if( $type === 6 ) {
$byte = ord( $buffer[$pos++] );
}
+ $this->leave( __METHOD__ );
return $result;
}
$isDir = ($mode === self::MODE_TREE || $mode === self::MODE_TREE_A);
+
+ // Recursive call tracked
$size = $isDir ? 0 : $this->getObjectSize( $entrySha );
Router.php
}
+ public function __destruct() {
+ echo $this->git->profileReport();
+ }
+
public function route(): Page {
$reqRepo = $_GET['repo'] ?? '';
Delta16 lines added, 2 lines removed, 14-line increase