summaryrefslogtreecommitdiffstats
path: root/src/shared/Builder.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-02 20:37:50 +0000
committerDavid Robillard <d@drobilla.net>2010-02-02 20:37:50 +0000
commita645d2b8be4d7d31f6eef1649156b166a01e0c31 (patch)
tree3d83c08e9a5460cc6582482bcfc673dff956a1e7 /src/shared/Builder.cpp
parent653679e967f11a0e008521885fcaf6994d2961fa (diff)
downloadingen-a645d2b8be4d7d31f6eef1649156b166a01e0c31.tar.gz
ingen-a645d2b8be4d7d31f6eef1649156b166a01e0c31.tar.bz2
ingen-a645d2b8be4d7d31f6eef1649156b166a01e0c31.zip
Use Glib string interning (quarks) to make Path/URI operator== very fast.
This avoids a ton of string comparison overhead in Ingen when setting various properties (e.g. "ingen:value" was compared several times every time a port value was changed, now this is just a single pointer comparison and the full round trip of a value change does no string comparison at all, but is still property based and RDFey). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2408 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared/Builder.cpp')
-rw-r--r--src/shared/Builder.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/shared/Builder.cpp b/src/shared/Builder.cpp
index 37c193fb..fd94ddd0 100644
--- a/src/shared/Builder.cpp
+++ b/src/shared/Builder.cpp
@@ -16,13 +16,16 @@
*/
#include "raul/Atom.hpp"
-#include "Builder.hpp"
#include "common/interface/CommonInterface.hpp"
#include "common/interface/Patch.hpp"
#include "common/interface/Node.hpp"
#include "common/interface/Port.hpp"
#include "common/interface/Connection.hpp"
#include "common/interface/Plugin.hpp"
+#include "module/ingen_module.hpp"
+#include "module/World.hpp"
+#include "shared/LV2URIMap.hpp"
+#include "Builder.hpp"
using namespace std;
using namespace Raul;
@@ -40,12 +43,13 @@ Builder::Builder(CommonInterface& interface)
void
Builder::build(SharedPtr<const GraphObject> object)
{
+ const LV2URIMap& uris = *ingen_get_world()->uris.get();
SharedPtr<const Patch> patch = PtrCast<const Patch>(object);
if (patch) {
if (!object->path().is_root()) {
Resource::Properties props;
- props.insert(make_pair("rdf:type", Atom(Atom::URI, "ingen:Patch")));
- props.insert(make_pair("ingen:polyphony", Atom(int32_t(patch->internal_polyphony()))));
+ props.insert(make_pair(uris.rdf_type, uris.ingen_Patch));
+ props.insert(make_pair(uris.ingen_polyphony, Atom(int32_t(patch->internal_polyphony()))));
_interface.put(object->path(), props);
}
@@ -60,8 +64,8 @@ Builder::build(SharedPtr<const GraphObject> object)
SharedPtr<const Node> node = PtrCast<const Node>(object);
if (node) {
Resource::Properties props;
- props.insert(make_pair("rdf:type", Atom(Atom::URI, "ingen:Node")));
- props.insert(make_pair("rdf:instanceOf", Atom(Atom::URI, node->plugin()->uri().str())));
+ props.insert(make_pair(uris.rdf_type, uris.ingen_Node));
+ props.insert(make_pair(uris.rdf_instanceOf, node->plugin()->uri()));
_interface.put(node->path(), props);
build_object(object);
return;