Jayson Santos wrote:
> On 17 fev, 14:00, bearophileh...@lycos.com wrote:
>> Jayson Santos:
>>
>> > After changing my code to use only functions instead classes
>> > my code is too much faster.
>> > Here cProfile statistcs:
>> > Using old code : 633608 function calls in 1.361 CPU seconds
>> > Using
Jayson Santos:
> And here is the final code:http://pastebin.com/f3e20d669
Note that if you use Psyco this lookup trick isn't useful, but if the
Psyco isn't available it can improve performance a little:
append = BitmapList['lines'].append
I suggest to replace this code:
red, green, blue
On 17 fev, 14:00, bearophileh...@lycos.com wrote:
> Jayson Santos:
>
> > After changing my code to use only functions instead classes
> > my code is too much faster.
> > Here cProfile statistcs:
> > Using old code : 633608 function calls in 1.361 CPU seconds
> > Using new code: 475487 function call
Jayson Santos:
> After changing my code to use only functions instead classes
> my code is too much faster.
> Here cProfile statistcs:
> Using old code : 633608 function calls in 1.361 CPU seconds
> Using new code: 475487 function calls in 0.800 CPU seconds
If you show a pastebin of the new versio
On 16 fev, 21:47, bearophileh...@lycos.com wrote:
> Jayson Santos:
>
> > Do I need use some patters or others progamming conventions ?
>
> That's a strong question...
> Knowing OOP well is important, and it's often a good way to program,
> etc. But... You may try to rewrite your code with functions
On Mon, 2009-02-16 at 16:47 -0800, bearophileh...@lycos.com wrote:
> Jayson Santos:
> > Do I need use some patters or others progamming conventions ?
>
> That's a strong question...
> Knowing OOP well is important, and it's often a good way to program,
> etc. But... You may try to rewrite your cod
Jayson Santos:
> Do I need use some patters or others progamming conventions ?
That's a strong question...
Knowing OOP well is important, and it's often a good way to program,
etc. But... You may try to rewrite your code with functions only and
no classes (well, you may need to use classes for the
On 16 fev, 20:41, bearophileh...@lycos.com wrote:
> Jayson Santos:
>
> > Here is the new code using your changeshttp://pastebin.com/m6dfe619d
> > And here is the profilerhttp://pastebin.com/m74d282b8
>
> I have suggested you to profile the program mostly for pedagogical
> purposes, it's often a goo
Jayson Santos:
> Here is the new code using your changeshttp://pastebin.com/m6dfe619d
> And here is the profilerhttp://pastebin.com/m74d282b8
I have suggested you to profile the program mostly for pedagogical
purposes, it's often a good thing to do if you want to speed up a
program. But now it's y
On 16 fev, 18:29, bearophileh...@lycos.com wrote:
> Jayson Santos:
>
> > Hello people, I'm writing a Bitmap parser for study purposes,
>
> This code:
>
> x = 0
> y = 0
> for line in bmp.bitmap_lines.lines:
> for color in xrange(len(line.colors)):
>
Jayson Santos:
> Hello people, I'm writing a Bitmap parser for study purposes,
This code:
x = 0
y = 0
for line in bmp.bitmap_lines.lines:
for color in xrange(len(line.colors)):
canvas.create_line(x, y, x+1, y, fill="#%02x%02x%02x"
% (line.colors
Jayson Santos wrote:
Hello people, I'm writing a Bitmap parser for study purposes, however
when I parse a bitmap file and when I paint that file in a window, the
script take to much time.
1. You turned constants into static methods called for every line,
adding attribute lookup and function ca
Hello people, I'm writing a Bitmap parser for study purposes, however
when I parse a bitmap file and when I paint that file in a window, the
script take to much time.
How can I optimize my script loops to be faster ?
Here is the script
http://pastebin.com/m652b8d65
Best Regards
Jayson Reis
--
ht
13 matches
Mail list logo