zsvo/pkg
itexpert228 1742b26f0b
Implement singleton resolver to prevent repeated Sources.xz parsing
Problem: Sources.xz was being parsed multiple times during single install command
- Each dependency lookup triggered fresh parsing of 37,633 packages
- This caused 6.5s delays repeatedly during installation

Solution: Implement singleton resolver using sync.Once
- Add GetGlobalResolver() function with sync.Once pattern
- Ensure Sources.xz is parsed only once per process
- Thread-safe implementation for concurrent access

Changes:
- pkg/resolver/global_resolver.go: Singleton resolver implementation
- pkg/loader/package_loader.go: Use GetGlobalResolver instead of NewFastResolver
- cmd/optimized_build.go: Use GetGlobalResolver with lazy initialization
- Add cacheDir fields to support singleton pattern

Performance Results:
- First resolver init: 477µs (includes parsing)
- Subsequent calls: 42ns (11,360x faster)
- Target achieved: <1ms for repeated calls

Expected Behavior:
- Sources.xz parsed once per process
- All subsequent resolver calls reuse same instance
- O(1) dependency lookups after initial load
2026-03-15 16:52:55 +03:00
..
builder feat: Add Nix-style binary cache, Linux sandbox, pacman UI, thermal management, fakeroot tests 2026-03-15 15:24:24 +03:00
cache zaebalsa 2026-03-15 16:14:13 +03:00
debian Improve dependency resolver with 5 major enhancements 2026-03-15 16:44:36 +03:00
deps parasha 2026-03-14 12:23:04 +03:00
errors рагшцр 2026-03-13 15:18:31 +03:00
fetcher feat: Add Nix-style binary cache, Linux sandbox, pacman UI, thermal management, fakeroot tests 2026-03-15 15:24:24 +03:00
i18n Fix LFS dependency handling - skip Debian-specific packages 2026-03-14 19:32:54 +03:00
installer Fix LFS dependency handling - skip Debian-specific packages 2026-03-14 19:32:54 +03:00
loader Implement singleton resolver to prevent repeated Sources.xz parsing 2026-03-15 16:52:55 +03:00
packager рагшцр 2026-03-13 15:18:31 +03:00
recipe рагшцр 2026-03-13 15:18:31 +03:00
resolver Implement singleton resolver to prevent repeated Sources.xz parsing 2026-03-15 16:52:55 +03:00
sandbox feat: Add Nix-style binary cache, Linux sandbox, pacman UI, thermal management, fakeroot tests 2026-03-15 15:24:24 +03:00
security рагшцр 2026-03-13 15:18:31 +03:00
types кал много кала......просто огромное количество кала.... 2026-03-13 00:37:11 +03:00
ui feat: Add Nix-style binary cache, Linux sandbox, pacman UI, thermal management, fakeroot tests 2026-03-15 15:24:24 +03:00