monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] nvm.experiment.pcre - boost::regex replacement


From: Zack Weinberg
Subject: [Monotone-devel] nvm.experiment.pcre - boost::regex replacement
Date: Mon, 18 Dec 2006 22:40:47 -0800

Earlier (some time earlier) today I pushed to venge some changes that
I mostly did on the airplane to and from Atlanta back last month and
hadn't had no time to finish testing since (yay exams).  What you'll
find on nvm.experiment.pcre is a version of monotone that uses Philip
Hazel's PCRE (Perl Compatible Regular Expressions) library instead of
boost::regex.

Why'd I do this?  Four reasons:

1) The libpcre.so provided by Debian is one-sixth the size of
libboost-regex.so, and furthermore it does not drag in ICU, which is
even larger.
2) The source code to PCRE is small enough that we can reasonably
bundle it.  I coded the autoconf tooling to detect and use a system
PCRE if available; we know distributors want us to move toward using
unbundled libraries, and PCRE is nice and stable, so this should not
pose us any problems.
3) We've been having compatibility problems with Boost lately, so I
thought it would be good to start stepping away from it, and the
regexp library is an obvious place to start since there *are*
near-drop-in replacements out there.
4) PCRE makes it possible to byte-compile our constant regexes (which
are most of our regexes) at Monotone build time, potentially reducing
the overhead of some operations, e.g. packet transport.  I haven't
finished coding this so I don't know if it's actually a win.

Note that I did *not* use the C++ interface provided (as a separate
module, libpcrecpp) by PCRE upstream; I wrote my own,
pcrewrap.{cc,hh}.  I did this primarily because upstream's interface
is, shall we say, not in the mode, and secondarily because there's no
way to probe for that library with pkg-config (unlike core PCRE).

Have at,
zw




reply via email to

[Prev in Thread] Current Thread [Next in Thread]