[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/sdk/kdevplatform/language/duchain
From:       Milian Wolff <mail () milianw ! de>
Date:       2010-04-06 20:35:00
Message-ID: 20100406203500.D7B65AC88F () svn ! kde ! org
[Download RAW message or body]

SVN commit 1111859 by mwolff:

optimize: don't call m_usesSize() and m_uses() in a loop, that is expensive

note: while compilers might optimize it, all us developers with our debug builts will \
greatly appreciate this since the cost for parsing only the cmake files in kdepimlibs \
goes down by ~40% with this change

 M  +3 -1      ducontext.cpp  


--- trunk/extragear/sdk/kdevplatform/language/duchain/ducontext.cpp #1111858:1111859
@@ -1466,7 +1466,9 @@
   if(insertBefore == -1) {
     //Find position where to insert
     unsigned int a = 0;
-    for(; a < d->m_usesSize() && range.start > d->m_uses()[a].m_range.start; ++a) { \
///@todo do binary search +    const unsigned int size = d->m_usesSize();
+    const Use* uses = d->m_uses();
+    for(; a < size && range.start > uses[a].m_range.start; ++a) { ///@todo do binary \
search  }
     insertBefore = a;
   }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic