Skip to content

Commit

Permalink
Interim/misc. Added installed ripgrep to benchmark suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvansickle committed Oct 23, 2016
1 parent 8b5ddb0 commit 5553946
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
20 changes: 11 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,15 @@ PKG_CHECK_MODULES([PCRE], [libpcre >= 8.21],
AC_SUBST([HAVE_LIBPCRE], [yes])
AC_DEFINE([HAVE_LIBPCRE], [1], [Define if libpcre is available.])
],
[AC_MSG_WARN([Unable to find libpcre: $PCRE_PKG_ERRORS])])
[AC_SUBST([HAVE_LIBPCRE], [no])])

PKG_CHECK_MODULES([PCRE2], [libpcre2-8 >= 10.20],
[
# Found it. Remember to add $PCRE2_LIBS, $PCRE2_CFLAGS, and $PCRE2_CPPFLAGS to the appropriate automake vars.
AC_SUBST([HAVE_LIBPCRE2], [yes])
AC_DEFINE([HAVE_LIBPCRE2], [1], [Define if libpcre2 is available.])
],
[AC_MSG_WARN([Unable to find libpcre2: $PCRE2_PKG_ERRORS])])

# Make sure we found at least one of them.
AS_IF([test "x$HAVE_LIBPCRE" = x -a "x$HAVE_LIBPCRE2" = x],
[AC_MSG_ERROR([unable to find a suitable pcre library.])],
[AC_MSG_NOTICE([found at least one usable pcre library.])])
[AC_SUBST([HAVE_LIBPCRE2], [no])])

AC_LANG_POP([C++])

Expand Down Expand Up @@ -313,9 +308,9 @@ AC_LANG_PUSH([C++])
# Check if the C++ compiler supports some flags we'd like to set.
# Append them to AM_CXXFLAGS if it does.
AX_APPEND_COMPILE_FLAGS([-fno-omit-frame-pointer], [AM_CXXFLAGS])
#AX_APPEND_COMPILE_FLAGS([-save-temps], [AM_CXXFLAGS]) # -fverbose-asm
#AX_APPEND_COMPILE_FLAGS([-save-temps], [AM_CXXFLAGS]) # -fverbose-asm
#AX_APPEND_COMPILE_FLAGS([-Wnoexcept], [AM_CXXFLAGS]) # Warn if something isn't marked noexcept when it could be. @note Doesn't seem to do anything.
AX_APPEND_COMPILE_FLAGS([-ftree-vectorize], [AM_CXXFLAGS]) # -fopt-info-optimized -msse4.2], [AM_CXXFLAGS]) # -fopt-info-vec-all
AX_APPEND_COMPILE_FLAGS([-ftree-vectorize], [AM_CXXFLAGS]) # -fopt-info-optimized -fopt-info-vec-all
#AX_APPEND_COMPILE_FLAGS([-flto -ffat-lto-objects], [AM_CXXFLAGS])
AX_APPEND_COMPILE_FLAGS([-pthread], [AM_CXXFLAGS])
AX_APPEND_COMPILE_FLAGS([-Wformat -Wformat-security], [AM_CXXFLAGS])
Expand Down Expand Up @@ -514,3 +509,10 @@ AC_MSG_NOTICE([
runpath_var: $runpath_var
])


# Make sure we found at least one of the PCRE libs.
AS_IF([test "x$HAVE_LIBPCRE" = x -a "x$HAVE_LIBPCRE2" = x],
[AC_MSG_ERROR([unable to find a suitable pcre library.])],
[AC_MSG_NOTICE([found at least one usable pcre library.])])

2 changes: 0 additions & 2 deletions src/libext/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ using dev_ino_pair_type = std::conditional<
uint_t<(sizeof(dev_t)+sizeof(ino_t))*8>::fast
>::type;

///static_assert(sizeof(dev_ino_pair_type) != 128/8, "ERROR");

struct dev_ino_pair
{
dev_ino_pair() = default;
Expand Down
4 changes: 4 additions & 0 deletions tests/atlocal.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ fi
#if PROG_ACK="$(which ack)";
#then
#fi
if PROG_INST_RIPGREP="$(which rg 2>/dev/null)";
then
PROGLIST=$PROGLIST,inst_ripgrep:$PROG_INST_RIPGREP
fi
if test -x "${PROG_PCRE2GREP}";
then
PROGLIST=$PROGLIST,inst_pcre2grep:$PROG_PCRE2GREP
Expand Down
1 change: 1 addition & 0 deletions tests/benchmark_progs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ built_ucg,ucg,true,--noenv,--dirjobs=,-j,--ignore-dir=,only_cpp_ack
inst_ucg,${PROG_INST_UCG},true,--noenv,--dirjobs=,-j,--ignore-dir=,only_cpp_ack
fake_for_test,nosuchprog,true,-Abc,,,--exclude-dir=,only_cpp_ack
inst_ag,${PROG_INST_AG},true,,,,--ignore-dir=,only_cpp_ack
inst_ripgrep,${PROG_INST_RIPGREP},false,,,-j,--glob !,only_cpp_rg
inst_pcre2grep,${PROG_PCRE2GREP},true,-rn --color,,,--exclude-dir=,only_cpp_pcre2grep
inst_system_grep,grep,false,-Ern --color,,,--exclude-dir=,only_cpp_grep
inst_gnu_grep_e,${PROG_GNU_GREP},false,-Ern --color,,,--exclude-dir=,only_cpp_grep
Expand Down
1 change: 1 addition & 0 deletions tests/opts_defs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ opt_id,opt_expansion
only_cpp_ack,--cpp
only_cpp_grep,--include=\\*.cpp --include=\\*.hpp --include=\\*.h --include=\\*.cc --include=\\*.cxx
only_cpp_pcre2grep,'--exclude=^.*(?<!\\.cpp|\\.hpp|\\.h|\\.cc|\\.cxx)$'
only_cpp_rg,-t cpp
12 changes: 6 additions & 6 deletions tests/test_cases.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
test_case_id, desc_short, desc_long, regex, corpus
TC1, Test case 1, "ucg vs. others, 'BOOST.*HPP' on Boost source.", BOOST.*HPP, "${top_srcdir}/../boost_1_58_0"
TC2, Test Case 2, "ucg vs. others, literal string on Boost source.", TEST_BOOST_NO_INTRINSIC_WCHAR_T, "${top_srcdir}/../boost_1_58_0"
TC3, Test Case 3, "ucg vs. others, regex 'iudice[\\w]*umputo' on single ~500MB file.", iudice[\\w]*umputo, "${builddir}/500MBLoremIpsum.cpp"
TC4, Test Case 4, "ucg vs. others, literal string on 500MB file, match at end.", iudicemaequumputo, "${builddir}/500MBLoremIpsum.cpp"
TC5, Test Case 5, "ucg vs. others, '#include\\s+".*"' on Boost source", #include\\s+".*", "${top_srcdir}/../boost_1_58_0"
TC6, Test Case 6, "ucg vs. others, literal '#endif' with --ignore-dir=doc on Boost source.", #endif, "${top_srcdir}/../boost_1_58_0"
TC1, Test case 1, "Benchmark: 'BOOST.*HPP' on Boost source.", BOOST.*HPP, "${top_srcdir}/../boost_1_58_0"
TC2, Test Case 2, "Benchmark: literal string on Boost source.", TEST_BOOST_NO_INTRINSIC_WCHAR_T, "${top_srcdir}/../boost_1_58_0"
TC3, Test Case 3, "Benchmark: regex 'iudice[\\w]*umputo' on single ~500MB file.", iudice[\\w]*umputo, "${builddir}/500MBLoremIpsum.cpp"
TC4, Test Case 4, "Benchmark: literal string on 500MB file, match at end.", iudicemaequumputo, "${builddir}/500MBLoremIpsum.cpp"
TC5, Test Case 5, "Benchmark: '#include\\s+".*"' on Boost source", #include\\s+".*", "${top_srcdir}/../boost_1_58_0"
TC6, Test Case 6, "Benchmark: literal '#endif' with --ignore-dir=doc on Boost source.", #endif, "${top_srcdir}/../boost_1_58_0"

0 comments on commit 5553946

Please sign in to comment.