Re: squeeze out some performance

2013-12-10 Thread Robin Becker
On 09/12/2013 20:46, Dave Angel wrote: On Mon, 09 Dec 2013 15:54:36 +, Robin Becker wrote: On 06/12/2013 22:07, Joel Goldstick wrote: > end, start = start, end a similar behaviour for simple assignments for less than 4 variables the tuple method is faster. What does speed have

Re: squeeze out some performance

2013-12-10 Thread Robert Voigtländer
> Actually for optimised code it looks very similar to some code posted > > here > > http://www.daniweb.com/software-development/python/threads/321181/python-bresenham-circle-arc-algorithm > > > over three years ago. > This is where it origins from. I just extended it for my needs and now

Re: squeeze out some performance

2013-12-09 Thread Mark Lawrence
On 06/12/2013 08:47, Robert Voigtländer wrote: Hi, I try to squeeze out some performance of the code pasted on the link below. http://pastebin.com/gMnqprST The code will be used to continuously analyze sonar sensor data. I set this up to calculate all coordinates in a sonar cone without heavy

Re: squeeze out some performance

2013-12-09 Thread Dave Angel
On Mon, 09 Dec 2013 15:54:36 +, Robin Becker wrote: On 06/12/2013 22:07, Joel Goldstick wrote: > end, start = start, end a similar behaviour for simple assignments for less than 4 variables the tuple method is faster. What does speed have to do with it? When you want to swap tw

Re: squeeze out some performance

2013-12-09 Thread Robin Becker
On 06/12/2013 22:07, Joel Goldstick wrote: .. Not that this will speed up your code but you have this: if not clockwise: s = start start = end end = s Python people would write: end, start = start, end this works for some small number of variabl

Re: squeeze out some performance

2013-12-09 Thread Mark Lawrence
to squeeze out some performance of the code pasted on the link below. http://pastebin.com/gMnqprST Several comments: 1) I find this program to be very difficult to read, largely because there's a whole LOT of duplicated code. Look at lines 53-80, and lines 108-287, and lines 294-311

Re: squeeze out some performance

2013-12-09 Thread Robert Voigtländer
Am Samstag, 7. Dezember 2013 00:01:49 UTC+1 schrieb Dan Stromberg: > On Fri, Dec 6, 2013 at 2:38 PM, Mark Lawrence wrote: > > > On 06/12/2013 16:52, John Ladasky wrote: > > > On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: > > >

Re: squeeze out some performance

2013-12-06 Thread Dan Stromberg
On Fri, Dec 6, 2013 at 2:38 PM, Mark Lawrence wrote: > On 06/12/2013 16:52, John Ladasky wrote: > >> On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: >> >> I try to squeeze out some performance of the code pasted on the link >>> below.

Re: squeeze out some performance

2013-12-06 Thread Mark Lawrence
On 06/12/2013 16:52, John Ladasky wrote: On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: I try to squeeze out some performance of the code pasted on the link below. http://pastebin.com/gMnqprST Several comments: 1) I find this program to be very difficult to read

Re: squeeze out some performance

2013-12-06 Thread Joel Goldstick
On Fri, Dec 6, 2013 at 11:52 AM, John Ladasky wrote: > On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: > > > I try to squeeze out some performance of the code pasted on the link > below. > > http://pastebin.com/gMnqprST > Not that this will sp

Re: squeeze out some performance

2013-12-06 Thread John Ladasky
On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote: > I try to squeeze out some performance of the code pasted on the link below. > http://pastebin.com/gMnqprST Several comments: 1) I find this program to be very difficult to read, largely because there's a w

Re: squeeze out some performance

2013-12-06 Thread Robert Voigtländer
Am Freitag, 6. Dezember 2013 17:36:03 UTC+1 schrieb Mark Lawrence: > > I already did some basic profiling and optimized a lot. Especially > with > > help of a goof python performance tips list I found. > > Wonderful typo -^ :) > Oh well :-) ... it was a good one. Just had a quick look at

Re: squeeze out some performance

2013-12-06 Thread Mark Lawrence
On 06/12/2013 16:29, Robert Voigtländer wrote: Thanks for your replies. I already did some basic profiling and optimized a lot. Especially > with help of a goof python performance tips list I found. Wonderful typo -^ :) I think I'll follow the cython path. The geometry approach also s

Re: squeeze out some performance

2013-12-06 Thread Robert Voigtländer
Thanks for your replies. I already did some basic profiling and optimized a lot. Especially with help of a goof python performance tips list I found. I think I'll follow the cython path. The geometry approach also sound good. But it's way above my math/geometry knowledge. Thanks for your input

Re: squeeze out some performance

2013-12-06 Thread Chris Angelico
On Fri, Dec 6, 2013 at 8:46 PM, Jeremy Sanders wrote: > This sort of code is probably harder to make faster in pure python. You > could try profiling it to see where the hot spots are. Perhaps the choice of > arrays or sets might have some speed impact. I'd make this recommendation MUCH stronger.

Re: squeeze out some performance

2013-12-06 Thread Jeremy Sanders
Robert Voigtländer wrote: > I try to squeeze out some performance of the code pasted on the link > below. http://pastebin.com/gMnqprST > > The code will be used to continuously analyze sonar sensor data. I set > this up to calculate all coordinates in a sonar cone witho

squeeze out some performance

2013-12-06 Thread Robert Voigtländer
Hi, I try to squeeze out some performance of the code pasted on the link below. http://pastebin.com/gMnqprST The code will be used to continuously analyze sonar sensor data. I set this up to calculate all coordinates in a sonar cone without heavy use of trigonometry (assuming that this way is