Re: help with making my code more efficient

2012-12-24 Thread larry.mart...@gmail.com
On Friday, December 21, 2012 11:47:10 PM UTC-7, Dave Angel wrote: > On 12/21/2012 11:47 PM, larry.mart...@gmail.com wrote: > > On Friday, December 21, 2012 8:19:37 PM UTC-7, Dave Angel wrote: > >> On 12/21/2012 03:36 PM, larry.mart...@gmail.com wrote: > >> > > I think you're misunderstanding

Re: help with making my code more efficient

2012-12-21 Thread Dave Angel
On 12/21/2012 11:47 PM, larry.mart...@gmail.com wrote: > On Friday, December 21, 2012 8:19:37 PM UTC-7, Dave Angel wrote: >> On 12/21/2012 03:36 PM, larry.mart...@gmail.com wrote: >> > I think you're misunderstanding what I need to do. I have a set of rows from > the database with tool, time

Re: help with making my code more efficient

2012-12-21 Thread larry.mart...@gmail.com
On Friday, December 21, 2012 8:19:37 PM UTC-7, Dave Angel wrote: > On 12/21/2012 03:36 PM, larry.mart...@gmail.com wrote: > > > On Friday, December 21, 2012 10:57:19 AM UTC-7, larry@gmail.com wrote: > > >> > > >> Didn't know about bisect. Thanks. I thought it would be my savior for > >> su

Re: help with making my code more efficient

2012-12-21 Thread Dave Angel
On 12/21/2012 03:36 PM, larry.mart...@gmail.com wrote: > On Friday, December 21, 2012 10:57:19 AM UTC-7, larry@gmail.com wrote: >> >> Didn't know about bisect. Thanks. I thought it would be my savior for sure. >> But unfortunaly when I added that, it blows up with out of memory. > The out of

Re: help with making my code more efficient

2012-12-21 Thread larry.mart...@gmail.com
On Friday, December 21, 2012 10:57:19 AM UTC-7, larry@gmail.com wrote: > On Thursday, December 20, 2012 8:31:18 PM UTC-7, Dave Angel wrote: > > On 12/20/2012 08:46 PM, larry.mart...@gmail.com wrote: > > > On Thursday, December 20, 2012 6:17:04 PM UTC-7, Dave Angel wrote: > > >> > > > Of co

Re: help with making my code more efficient

2012-12-21 Thread larry.mart...@gmail.com
On Thursday, December 20, 2012 8:31:18 PM UTC-7, Dave Angel wrote: > On 12/20/2012 08:46 PM, larry.mart...@gmail.com wrote: > > > On Thursday, December 20, 2012 6:17:04 PM UTC-7, Dave Angel wrote: > > >> > > > Of course it's a fragment - it's part of a large program and I was just > > showing

Re: help with making my code more efficient

2012-12-20 Thread Roy Smith
In article , "larry.mart...@gmail.com" wrote: > On Thursday, December 20, 2012 5:38:03 PM UTC-7, Chris Angelico wrote: > > On Fri, Dec 21, 2012 at 11:19 AM, larry.mart...@gmail.com > > > > wrote: > > > > > This code works, but it takes way too long to run - e.g. when cdata has > > > 600,000

Re: help with making my code more efficient

2012-12-20 Thread Dave Angel
On 12/20/2012 08:46 PM, larry.mart...@gmail.com wrote: > On Thursday, December 20, 2012 6:17:04 PM UTC-7, Dave Angel wrote: >> > Of course it's a fragment - it's part of a large program and I was just > showing the relevant parts. But it seems these are methods in a class, or something, so we're

Re: help with making my code more efficient

2012-12-20 Thread Chris Angelico
On Fri, Dec 21, 2012 at 11:43 AM, larry.mart...@gmail.com wrote: > It came from a database. Originally I was getting just the data I wanted > using SQL, but that was taking too long also. I was selecting just the > messages I wanted, then for each one of those doing another query to get the > d

Re: help with making my code more efficient

2012-12-20 Thread Mitya Sirenef
On 12/20/2012 09:39 PM, Mitya Sirenef wrote: On 12/20/2012 08:46 PM, larry.mart...@gmail.com wrote: On Thursday, December 20, 2012 6:17:04 PM UTC-7, Dave Angel wrote: On 12/20/2012 07:19 PM, larry.mart...@gmail.com wrote: I have a list of tuples that contains a tool_id, a time, and a message.

Re: help with making my code more efficient

2012-12-20 Thread Mitya Sirenef
On 12/20/2012 08:46 PM, larry.mart...@gmail.com wrote: On Thursday, December 20, 2012 6:17:04 PM UTC-7, Dave Angel wrote: On 12/20/2012 07:19 PM, larry.mart...@gmail.com wrote: I have a list of tuples that contains a tool_id, a time, and a message. I want to select from this list all the elem

Re: help with making my code more efficient

2012-12-20 Thread MRAB
On 2012-12-21 00:19, larry.mart...@gmail.com wrote: I have a list of tuples that contains a tool_id, a time, and a message. I want to select from this list all the elements where the message matches some string, and all the other elements where the time is within some diff of any matching mess

Re: help with making my code more efficient

2012-12-20 Thread larry.mart...@gmail.com
On Thursday, December 20, 2012 6:17:04 PM UTC-7, Dave Angel wrote: > On 12/20/2012 07:19 PM, larry.mart...@gmail.com wrote: > > > I have a list of tuples that contains a tool_id, a time, and a message. I > > want to select from this list all the elements where the message matches > > some string

Re: help with making my code more efficient

2012-12-20 Thread Dave Angel
On 12/20/2012 07:19 PM, larry.mart...@gmail.com wrote: > I have a list of tuples that contains a tool_id, a time, and a message. I > want to select from this list all the elements where the message matches some > string, and all the other elements where the time is within some diff of any > matc

Re: help with making my code more efficient

2012-12-20 Thread larry.mart...@gmail.com
On Thursday, December 20, 2012 5:38:03 PM UTC-7, Chris Angelico wrote: > On Fri, Dec 21, 2012 at 11:19 AM, larry.mart...@gmail.com > > wrote: > > > This code works, but it takes way too long to run - e.g. when cdata has > > 600,000 elements (which is typical for my app) it takes 2 hours for thi

Re: help with making my code more efficient

2012-12-20 Thread Chris Angelico
On Fri, Dec 21, 2012 at 11:19 AM, larry.mart...@gmail.com wrote: > This code works, but it takes way too long to run - e.g. when cdata has > 600,000 elements (which is typical for my app) it takes 2 hours for this to > run. > > Can anyone give me some suggestions on speeding this up? > It sound