If in initializeDB you comment out:
ipEngine1.SetVariable("pred_file", predfile); ipEngine1.Execute(@"db.load_predicates_file(pred_file)"); does it get much faster? If it doesn't then the problem is squarely an IronPython problem and we'll need to investigate further. The more static one has some issues... The GetObjectArray() call will be really expensive if your edges grow to be very big (it'll copy the array). Maybe that's what you need to do here though (and it looks like edge just grows unbounded as it never gets cleared). You also might be able to get rid of the Ops.GetEnumerator call for the Tuple, not that that should be very expensive though. NodesCollection is a StringCollection? Also, are you taking your performance measurements at the console, or in an imported py file? In general our performance is much better in imported files than it is at the console. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JoeSox Sent: Wednesday, April 19, 2006 10:41 AM To: Discussion of IronPython Subject: Re: [IronPython] Speed test On 4/19/06, Dino Viehland <[EMAIL PROTECTED]> wrote: > Interop w/ C# shouldn't really cost you that much - it should actually be > able to give you speed gains as you fall back into the static world... > > Do you know if most of the time is being spent in the XmlTextReader or in > IronPython after that? It just passes an else and and catch. I posted the rough draft of the test method here if you wish to see in more detail http://joeswammi.com/projects/InitializeDB.txt That test method above is a quickly modified version of an another method that actually passes out a StringCollection. Sorry, I haven't modified the code to be more reflective of what it is actually doing. But I believe I have captured the times correctly. And it seems to successfully create the semantic network of the predicate files within the PythonEngine. >And I'm having trouble parsing "but things slow down significantly when I try to enumerate the StringCollection into a PythonEngine". Is this just doing a set variable, or are you looping over the collection and doing a set variable one at a time? > Yes, here is a test method I used using unpp() http://joeswammi.com/projects/load_predicate_files.txt Ideally, this C# load_predicate_files() method would actually create the semantic dictionaries instead of passing the StringCollection nodes to just unpp(). I did try a more static approach... http://joeswammi.com/projects/load_predicate_files2.txt But I didn't like the results, could be my own fault though. It was very slow esp. when it reached around 3000 predicate lines from the StringCollection. -- Joseph _______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com