Faster Pacman (Lightning Memory-Mapped Database Solution)

Pacman is one of the fastest linux package manager but it has one problem makes it slow and annoying and itโ€™s the local package database
We talked about it here :backhand_index_pointing_down:

Im working on new pacman fork still alpha 12% on progress that nuke this problem
Entirely and replace it with Lightning Memory-Mapped Database file

[ pacman CLI ] 
      โ”‚
      โ–ผ
[ libalpm public API ] 
      โ”‚
      โ–ผ
[ be_local.c (Filesystem Driver) ]
      โ”œโ”€โ”€ /var/lib/pacman/local/
      โ”‚     โ”œโ”€โ”€ git-2.45.0-1/
      โ”‚     โ”‚     โ”œโ”€โ”€ desc      (Plain text file)
      โ”‚     โ”‚     โ”œโ”€โ”€ files     (Plain text file)
      โ”‚     โ”‚     โ””โ”€โ”€ depends   (Plain text file)
      โ”‚     โ”œโ”€โ”€ gcc-14.1.0-1/
      โ”‚     โ”‚     โ”œโ”€โ”€ desc
      โ”‚     โ”‚     โ””โ”€โ”€ ...
      โ”‚     โ””โ”€โ”€ [ Thousands of other package directories... ]
      โ”‚
      โ–ผ
[ OS VFS / Disk Inode Traversal (High I/O Overhead) ]

Optimized new Memory-Mapped LMDB database

[ pacman++ CLI ] 
      โ”‚
      โ–ผ
[ libalpm public API (C++20) ] 
      โ”‚
      โ–ผ
[ be_local.cc (LMDB Storage Driver) ]
      โ”‚
      โ–ผ
[ /var/lib/pacman/local.mdb (Single File Container) ]
      โ”œโ”€โ”€ B+Tree Root: Package Metadata Index
      โ”œโ”€โ”€ B+Tree Root: File Ownership Index (-Qo)
      โ””โ”€โ”€ B+Tree Root: Provides / Conflicts Index
      โ”‚
      โ–ผ
[ OS Kernel mmap() / Page Cache (Zero-Copy RAM Pointers) ]
2 Likes