Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1801

Long slists are very slow to parse

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Rejected
    • Priority: Medium
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Parsing
    • Labels:
    • Platform:
      Linux

      Description

      Continuing on Bug #6672, it seems that long slists take way too much time to parse. So I took some time to run the relevant acceptance test under Valgrind's callgrind:

      LD_LIBRARY_PATH=`pwd`/libpromises/.libs  valgrind --tool=callgrind    cf-agent/.libs/cf-agent \
          -f ./tests/acceptance/01_vars/01_basic/parse_long_slists.cf -b init
      

      Here is the important stuff from valgrind's output (full logs attached). There is an enormous hot path ending at @libpromises/rlist.c:RlistAppendRval@:

      --------------------------------------------------------------------------------
                 Ir 
      --------------------------------------------------------------------------------
      5,932,529,856  PROGRAM TOTALS
      
      --------------------------------------------------------------------------------
                 Ir  file:function
      --------------------------------------------------------------------------------
      4,815,815,801  libpromises/rlist.c:RlistAppendRval [/home/a10038/Desktop/CFEngine/samedir/core/libpromises/.libs/libpromises.so.3.0.6]
        222,380,318  /build/buildd/eglibc-2.19/malloc/malloc.c:_int_malloc [/lib/x86_64-linux-gnu/libc-2.19.so]
        110,664,148  /build/buildd/eglibc-2.19/malloc/malloc.c:_int_free [/lib/x86_64-linux-gnu/libc-2.19.so]
         53,092,840  /build/buildd/eglibc-2.19/malloc/malloc.c:malloc [/lib/x86_64-linux-gnu/libc-2.19.so]
         46,219,285  libpromises/rlist.c:RlistFlatten [/home/a10038/Desktop/CFEngine/samedir/core/libpromises/.libs/libpromises.so.3.0.6]
         43,040,059  /build/buildd/eglibc-2.19/malloc/malloc.c:malloc_consolidate [/lib/x86_64-linux-gnu/libc-2.19.so]
         26,690,628  /build/buildd/eglibc-2.19/nptl/../nptl/pthread_mutex_lock.c:pthread_mutex_lock [/lib/x86_64-linux-gnu/libpthread-2.19.so]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10038 jimis (Dimitrios Apostolou)
                Reporter:
                a10038 jimis (Dimitrios Apostolou)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel