diff options
author | Johannes Huber <johu@gentoo.org> | 2012-04-04 11:01:59 +0000 |
---|---|---|
committer | Johannes Huber <johu@gentoo.org> | 2012-04-04 11:01:59 +0000 |
commit | 7ba280c530debecece4c0bffb4f7ca47c2aa7824 (patch) | |
tree | 867e409d3e4b111b284115158e6fb4a24e627adf /kde-base/nepomuk | |
parent | Revision bump unbundles xdg-utils by Alec Moskvin <alecm@gmx.com> wrt bug #40... (diff) | |
download | historical-7ba280c530debecece4c0bffb4f7ca47c2aa7824.tar.gz historical-7ba280c530debecece4c0bffb4f7ca47c2aa7824.tar.bz2 historical-7ba280c530debecece4c0bffb4f7ca47c2aa7824.zip |
Revision bump adds upstream patch to improve perfomance on resource identification spotted by scarabeus.
Package-Manager: portage-2.2.0_alpha98/cvs/Linux i686
Diffstat (limited to 'kde-base/nepomuk')
-rw-r--r-- | kde-base/nepomuk/ChangeLog | 10 | ||||
-rw-r--r-- | kde-base/nepomuk/Manifest | 19 | ||||
-rw-r--r-- | kde-base/nepomuk/files/nepomuk-4.8.1-performance.patch | 151 | ||||
-rw-r--r-- | kde-base/nepomuk/nepomuk-4.8.1-r1.ebuild (renamed from kde-base/nepomuk/nepomuk-4.8.1.ebuild) | 6 |
4 files changed, 177 insertions, 9 deletions
diff --git a/kde-base/nepomuk/ChangeLog b/kde-base/nepomuk/ChangeLog index 851a5b3c5863..2c83719847c0 100644 --- a/kde-base/nepomuk/ChangeLog +++ b/kde-base/nepomuk/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for kde-base/nepomuk # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/nepomuk/ChangeLog,v 1.119 2012/03/31 13:52:13 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/nepomuk/ChangeLog,v 1.120 2012/04/04 11:01:59 johu Exp $ + +*nepomuk-4.8.1-r1 (04 Apr 2012) + + 04 Apr 2012; Johannes Huber <johu@gentoo.org> + +files/nepomuk-4.8.1-performance.patch, +nepomuk-4.8.1-r1.ebuild, + -nepomuk-4.8.1.ebuild: + Revision bump adds upstream patch to improve perfomance on resource + identification spotted by scarabeus. 31 Mar 2012; Markus Meier <maekke@gentoo.org> nepomuk-4.8.1.ebuild: add ~arm, bug #402989 diff --git a/kde-base/nepomuk/Manifest b/kde-base/nepomuk/Manifest index 64bb7ae4804c..495196102624 100644 --- a/kde-base/nepomuk/Manifest +++ b/kde-base/nepomuk/Manifest @@ -1,16 +1,21 @@ -----BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 +Hash: SHA512 +AUX nepomuk-4.8.1-performance.patch 5917 RMD160 33f9cd5c04cf4f929ac5b33bbdfe59b232f66e0c SHA1 bbe57e6d0f89f79d96cc5204287a20e5e507c708 SHA256 591f4596c2a04d8c049dcb04dab14d6365378df55b0d1952d10d0df7e31450f0 DIST kde-runtime-4.7.4.tar.bz2 6026460 RMD160 0b35753ef335268d2705a61218fa92c88f13e4da SHA1 bf5c266b7748cda44cc3a2fb231a2d6dde2b09f6 SHA256 8d1bd0712ca8f9c6f4700f481a0201938165026b75e05fe7b0c5b9a30dd9dd1a DIST kde-runtime-4.8.1.tar.xz 5761688 RMD160 15122a1e39a1db63345742583c14d98b0e3e96bc SHA1 82b57dc38335716fb382a665b536a9aece4684d6 SHA256 1f2dae51075f93ffd357968e3805527cad32a92b12a8e8bbb1d135eef679c51b EBUILD nepomuk-4.7.4.ebuild 640 RMD160 70ac26c7d8c589dea6c043b2c8c92e77a22e2c04 SHA1 3d56b1e5303b4dc563630ff0e06d4e8aa93c82c0 SHA256 38452035bb36ce5987fd8f2e00a40b2a7ce92b33bf925e0c24f54e36aea93ce6 -EBUILD nepomuk-4.8.1.ebuild 630 RMD160 befe5ac9c96dbb271802414b785d8403982bae50 SHA1 23e3d940532cc4bb15195d78f44a8f0d42126b47 SHA256 838d7aa85c3536733d449ae3ce63c9b7f690c41244155a5a13d38607d126f9fd -MISC ChangeLog 14553 RMD160 ba14108477120bb5d378d5def25b2428734b5bdd SHA1 01200cdc9c8cb6d25564e1005f2c38cd7fcfe56d SHA256 4582ab1a3683c47ed43fac3261db6942120963abf9fc57eb83b92e13d00e3f32 +EBUILD nepomuk-4.8.1-r1.ebuild 682 RMD160 cadc0f63d12ed81df9439fbf261882cc303efcb5 SHA1 3be04cc4d59d35b2d049f34f45bdad8207e4300a SHA256 d54079bdb35324bbea72209d7e2c93e2f2ac58f4c832aeddd5dd3b7d7d01927f +MISC ChangeLog 14835 RMD160 aed75f9bcfce59df475634aa65a5b3e8e3c052ef SHA1 369439d4ba1f90eaeaca081a0b676b84294d1842 SHA256 0010ad525ab904d07f69bdd7b184fe04fe82b2413a93727bf90fd10fd95d0f9b MISC metadata.xml 156 RMD160 ecce3b981f150c45ae1e84e2d208e678d6124259 SHA1 b64f7c0b4e5db816d82ad19848f72118af129d35 SHA256 2f4da28506b9d4185f320f67a6191d30c7a921217ed4447ed46ea0bc4aefc79a -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.17 (GNU/Linux) +Version: GnuPG v2.0.18 (GNU/Linux) -iEYEARECAAYFAk93DLkACgkQkKaRLQcq0GKyPgCeKTprIUXB0Yxd7Xyf0btwu1PQ -KOgAn1ngijzARerqwxcjkL/CmiVCwKIJ -=NCsl +iQEcBAEBCgAGBQJPfCpCAAoJEO+t9ga+3I3a6jcH/Ajck8ejwXXkseXFPQKpefBf +/gXaVKm+T+c7LTc9BWOwDdTKis/2Dv8Y6wuGMBmI3ndwky19YyuvX3VjZVjJ+t3C +pUUnRNEZsO2oIF679MAq/eZPLO9xvq8tH541RHfgD914YZardncxxKV9OEuIHkME +qmEJqnbA+6Oa3+584E9yWWLLRjyEN6AhsR7eorvYnQVdvfTbG3g+vVGL4F3fJQdo +SXpGmy5mpgsGzUe+9/4tQYH6j3HCO+9qXTL/q79esqk8IdYeZkF3sCSYJCQnUkB/ +ch2IJmo2STBAlSOuf/mJJCvFF6h+wNhMwnQ14ro44zoyaGSz1fNYs42hjpie3Cw= +=sU3k -----END PGP SIGNATURE----- diff --git a/kde-base/nepomuk/files/nepomuk-4.8.1-performance.patch b/kde-base/nepomuk/files/nepomuk-4.8.1-performance.patch new file mode 100644 index 000000000000..06d01e7702db --- /dev/null +++ b/kde-base/nepomuk/files/nepomuk-4.8.1-performance.patch @@ -0,0 +1,151 @@ +commit 754275eda610dce1160286a76339353097d8764c +Author: Sebastian Trueg <trueg@kde.org> +Date: Fri Mar 9 17:17:48 2012 +0100 + + Backport from nepomuk-core: improved performance on res identification. + + BUG: 289932 + FIXED-IN: 4.8.2 + +diff --git a/nepomuk/services/backupsync/lib/resourceidentifier.cpp b/nepomuk/services/backupsync/lib/resourceidentifier.cpp +index c1a9919..894372c 100644 +--- a/nepomuk/services/backupsync/lib/resourceidentifier.cpp ++++ b/nepomuk/services/backupsync/lib/resourceidentifier.cpp +@@ -31,6 +31,7 @@ + #include <Soprano/Statement> + #include <Soprano/Graph> + #include <Soprano/Node> ++#include <Soprano/BindingSet> + #include <Soprano/StatementIterator> + #include <Soprano/QueryResultIterator> + #include <Soprano/Model> +@@ -176,19 +177,18 @@ bool Nepomuk::Sync::ResourceIdentifier::runIdentification(const KUrl& uri) + return false; + } + +- QString query; +- + QStringList identifyingProperties; + QHash<KUrl, Soprano::Node> identifyingPropertiesHash; + + QHash< KUrl, Soprano::Node >::const_iterator it = res.constBegin(); + QHash< KUrl, Soprano::Node >::const_iterator constEnd = res.constEnd(); ++ QList<Soprano::Node> requiredTypes; + for( ; it != constEnd; it++ ) { + const QUrl & prop = it.key(); + + // Special handling for rdf:type + if( prop == RDF::type() ) { +- query += QString::fromLatin1(" ?r a %1 . ").arg( it.value().toN3() ); ++ requiredTypes << it.value().uri(); + continue; + } + +@@ -219,6 +219,10 @@ bool Nepomuk::Sync::ResourceIdentifier::runIdentification(const KUrl& uri) + return false; + } + ++ ++ // construct the identification query ++ QString query = QLatin1String("select distinct ?r where { "); ++ + // + // Optimization: + // If there is only one identifying property using all that optional and filter stuff +@@ -235,7 +239,7 @@ bool Nepomuk::Sync::ResourceIdentifier::runIdentification(const KUrl& uri) + QString::number( numIdentifyingProperties++ ) ); + } + +- // Make sure atleast one of the identification properties has been matched ++ // Make sure at least one of the identification properties has been matched + // by adding filter( bound(?o1) || bound(?o2) ... ) + query += QString::fromLatin1("filter( "); + for( int i=0; i<numIdentifyingProperties-1; i++ ) { +@@ -247,43 +251,68 @@ bool Nepomuk::Sync::ResourceIdentifier::runIdentification(const KUrl& uri) + query += QString::fromLatin1("?r %1 %2 . ").arg(Soprano::Node::resourceToN3(identifyingPropertiesHash.constBegin().key()), + identifyingPropertiesHash.constBegin().value().toN3()); + } +- query += QLatin1String("}"); + +- // Construct the entire query +- QString queryBegin = QString::fromLatin1("select distinct ?r count(?p) as ?cnt " +- "where { ?r ?p ?o. filter( ?p in (%1) ).") +- .arg( identifyingProperties.join(",") ); +- +- query = queryBegin + query + QString::fromLatin1(" order by desc(?cnt)"); ++ // ++ // For performance reasons we add a limit even though this could mean that we ++ // miss a resource to identify since we check the types below. ++ // ++ query += QLatin1String("} LIMIT 100"); + +- kDebug() << query; + + // +- // Only store the results which have the maximum score ++ // Fetch a score for each result. ++ // We do this in a separate query for performance reasons. + // +- QSet<KUrl> results; +- int score = -1; ++ QMultiHash<int, KUrl> resultsScoreHash; ++ int maxScore = -1; + Soprano::QueryResultIterator qit = d->m_model->executeQuery( query, Soprano::Query::QueryLanguageSparql ); + while( qit.next() ) { +- //kDebug() << "RESULT: " << qit["r"] << " " << qit["cnt"]; ++ const Soprano::Node r(qit["r"]); ++ ++ // ++ // Check the type requirements. Experiments have shown this to mean a substantial ++ // performance boost as compared to doing it in the main query. ++ // ++ if(!requiredTypes.isEmpty() ) { ++ query = QLatin1String("ask where { "); ++ foreach(const Soprano::Node& type, requiredTypes) { ++ query += QString::fromLatin1("%1 a %2 . ").arg(r.toN3(), type.toN3()); ++ } ++ query += QLatin1String("}"); ++ if(!d->m_model->executeQuery(query, Soprano::Query::QueryLanguageSparql).boolValue()) { ++ continue; ++ } ++ } ++ ++ ++ const int score = d->m_model->executeQuery(QString::fromLatin1("select count(?p) as ?cnt where { " ++ "%1 ?p ?o. filter( ?p in (%2) ) . }") ++ .arg( r.toN3(), ++ identifyingProperties.join(",") ), ++ Soprano::Query::QueryLanguageSparql) ++ .allBindings().first()["cnt"].literal().toInt(); + +- int count = qit["cnt"].literal().toInt(); +- if( score == -1 ) { +- score = count; ++ if( maxScore < score ) { ++ maxScore = score; + } +- else if( count < score ) +- break; + +- results << qit["r"].uri(); ++ resultsScoreHash.insert(score, r.uri()); + } + ++ // ++ // Only get the results which have the maximum score ++ // ++ QSet<KUrl> results = QSet<KUrl>::fromList(resultsScoreHash.values(maxScore)); ++ ++ + //kDebug() << "Got " << results.size() << " results"; + if( results.empty() ) + return false; + + KUrl newUri; +- if( results.size() == 1 ) ++ if( results.size() == 1 ) { + newUri = *results.begin(); ++ } + else { + kDebug() << "DUPLICATE RESULTS!"; + newUri = duplicateMatch( res.uri(), results ); diff --git a/kde-base/nepomuk/nepomuk-4.8.1.ebuild b/kde-base/nepomuk/nepomuk-4.8.1-r1.ebuild index eb1a6c42229f..705c403b13db 100644 --- a/kde-base/nepomuk/nepomuk-4.8.1.ebuild +++ b/kde-base/nepomuk/nepomuk-4.8.1-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/nepomuk/nepomuk-4.8.1.ebuild,v 1.3 2012/03/31 13:52:13 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/nepomuk/nepomuk-4.8.1-r1.ebuild,v 1.1 2012/04/04 11:01:59 johu Exp $ EAPI=4 @@ -22,3 +22,7 @@ RDEPEND="${DEPEND}" RESTRICT="test" # bug 392989 + +PATCHES=( + "${FILESDIR}/${P}-performance.patch" +) |