[pacman-dev] [PATCH] _alpm_db_search-cleanup: remove needless regex compilation, string duplication and code cleanup
Hi, * avoid repeated regex compilations (regex for search string do not change while scanning the package database) * remove needless string duplication (regex function do not change target string nor free them) * code cleanup This patch improves search performance: bash-3.2$ time ./src/pacman/pacman.static.old -Ss "(database|web).*server" >/dev/null real 0m1.026s user 0m0.544s sys 0m0.208s bash-3.2$ time ./src/pacman/pacman.static -Ss "(database|web).*server" >/dev/null real 0m0.777s user 0m0.456s sys 0m0.128s bash-3.2$ Jürgen
On 1/16/07, Jürgen Hötzel <juergen@hoetzel.info> wrote:
* avoid repeated regex compilations (regex for search string do not change while scanning the package database)
* remove needless string duplication (regex function do not change target string nor free them)
* code cleanup
Applied. Thanks a lot!
participants (2)
-
Aaron Griffin
-
Jürgen Hötzel