From: Rob V. <rv...@do...> - 2014-06-05 09:00:02
|
Ah so that makes a lot more sense now Yes GetUriNode() will be slow because it is a linear scan of the data and is not indexed in any way so yes the performance will degrade depending where in the in-memory data structures the given URI occurs. Since it looks like you are already extracting the URIs from the data somehow (you omitted the GetComponentUris() method from the code you sent) then you already know that the URI exists in the data. Therefore it is much better to simply use CreateUriNode() instead which will be a constant time operation. Eventually the GetXNode() methods will be removed from the API in part because of this performance issue and also because they only returns nodes if they exist in the subject/object position. Future releases will mark these methods as obsolete Rob From: Redouane Bali <red...@is...> Date: Wednesday, 4 June 2014 18:29 To: Rob Vesse <rv...@do...> Subject: [DotNetRdf] GetUriNode(Uri) execution time > Hi, > > My data is 'CIM' format > ( http://en.wikipedia.org/wiki/Common_Information_Model_(electricity) «The CIM > can be used to derive 'design artifacts' (e.g. XML Schema > <http://en.wikipedia.org/wiki/XML_Schema> , RDF Schema > <http://en.wikipedia.org/wiki/RDF_Schema> ) as needed for the integration of > related application software > <http://en.wikipedia.org/wiki/Application_software> .» ) > > The file I'm working on is about 4mo and my graph contains 59943 triples. > > There is in this pdf an example of a strange behavior about GetUriNode > increasing execution time. At the beginning, the graph is able to perform this > method in few ms, but in the last iterations, it takes about 80ms. > I hope you'll understand. > > Have a good day. > > PS : Effectively, the performance is about 25% better without using visual > studio. > > -- > Redouane Bali > 06.62.58.06.64 |