summaryrefslogtreecommitdiffstats
path: root/src/module
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/module
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/module')
-rw-r--r--src/module/World.hpp3
-rw-r--r--src/module/ingen_module.cpp9
2 files changed, 11 insertions, 1 deletions
diff --git a/src/module/World.hpp b/src/module/World.hpp
index e1ccf5d1..9f962af1 100644
--- a/src/module/World.hpp
+++ b/src/module/World.hpp
@@ -40,6 +40,7 @@ namespace Shared {
class EngineInterface;
class Store;
class LV2Features;
+class LV2URIMap;
/** The "world" all Ingen modules may share.
@@ -73,6 +74,8 @@ struct World {
SLV2World slv2_world;
LV2Features* lv2_features;
+ boost::shared_ptr<LV2URIMap> uris;
+
boost::shared_ptr<EngineInterface> engine;
boost::shared_ptr<Engine> local_engine;
boost::shared_ptr<Serialisation::Serialiser> serialiser;
diff --git a/src/module/ingen_module.cpp b/src/module/ingen_module.cpp
index 5faefebc..167fd0f2 100644
--- a/src/module/ingen_module.cpp
+++ b/src/module/ingen_module.cpp
@@ -16,10 +16,12 @@
*/
#include "redlandmm/World.hpp"
+#include "uri-map.lv2/uri-map.h"
+#include "ingen-config.h"
#include "shared/LV2Features.hpp"
+#include "shared/LV2URIMap.hpp"
#include "ingen_module.hpp"
#include "World.hpp"
-#include "ingen-config.h"
#ifdef HAVE_SLV2
#include "slv2/slv2.h"
#endif
@@ -39,7 +41,12 @@ ingen_get_world()
#ifdef HAVE_SLV2
world->slv2_world = slv2_world_new_using_rdf_world(world->rdf_world->world());
world->lv2_features = new Ingen::Shared::LV2Features();
+ world->uris = PtrCast<Ingen::Shared::LV2URIMap>(
+ world->lv2_features->feature(LV2_URI_MAP_URI));
slv2_world_load_all(world->slv2_world);
+#else
+ world->uris = SharedPtr<Ingen::Shared::LV2URIMap>(
+ new Ingen::Shared::LV2URIMap());
#endif
world->engine.reset();
world->local_engine.reset();