diff options
author | David Robillard <d@drobilla.net> | 2010-02-02 20:37:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-02 20:37:50 +0000 |
commit | a645d2b8be4d7d31f6eef1649156b166a01e0c31 (patch) | |
tree | 3d83c08e9a5460cc6582482bcfc673dff956a1e7 /src/engine/events/CreatePatch.cpp | |
parent | 653679e967f11a0e008521885fcaf6994d2961fa (diff) | |
download | ingen-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/engine/events/CreatePatch.cpp')
-rw-r--r-- | src/engine/events/CreatePatch.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/events/CreatePatch.cpp b/src/engine/events/CreatePatch.cpp index b76efcdc..5d72f13a 100644 --- a/src/engine/events/CreatePatch.cpp +++ b/src/engine/events/CreatePatch.cpp @@ -17,6 +17,7 @@ #include "raul/Maid.hpp" #include "raul/Path.hpp" +#include "shared/LV2URIMap.hpp" #include "events/CreatePatch.hpp" #include "Responder.hpp" #include "PatchImpl.hpp" @@ -83,11 +84,13 @@ CreatePatch::pre_process() if (_parent != NULL && _poly > 1 && _poly == static_cast<int>(_parent->internal_polyphony())) poly = _poly; - _patch = new PatchImpl(_engine, path.name(), poly, _parent, + const LV2URIMap& uris = *_engine.world()->uris.get(); + + _patch = new PatchImpl(_engine, path.symbol(), poly, _parent, _engine.driver()->sample_rate(), _engine.driver()->buffer_size(), _poly); _patch->meta().properties().insert(_properties.begin(), _properties.end()); - _patch->meta().set_property("rdf:type", Atom(Atom::URI, "ingen:Patch")); - _patch->set_property("rdf:type", Atom(Atom::URI, "ingen:Node")); + _patch->meta().set_property(uris.rdf_type, uris.ingen_Patch); + _patch->set_property(uris.rdf_type, uris.ingen_Node); if (_parent != NULL) { _parent->add_node(new PatchImpl::Nodes::Node(_patch)); |