Re: performance coding project? (was: Re: When to cache)

2002-02-01 Thread Ask Bjoern Hansen
On Sat, 26 Jan 2002, Stas Bekman wrote: [...] It's much better to build your system, profile it, and fix the bottlenecks. The most effective changes are almost never simple coding changes like the one you showed, but rather large things like using qmail-inject instead of SMTP, caching a

Re: performance coding project? (was: Re: When to cache)

2002-02-01 Thread Ask Bjoern Hansen
On Sat, 26 Jan 2002, Perrin Harkins wrote: It all depends on what kind of application do you have. If you code is CPU-bound these seemingly insignificant optimizations can have a very significant influence on the overall service performance. Do such beasts really exist? I mean, I guess

Re: performance coding project? (was: Re: When to cache)

2002-01-31 Thread raptor
One memory speed saving is using global VARS, I know it is not recomended practice, but if from the begining of the project u set a convention what are the names of global vars it is ok..F.e. I'm using in all DB pages at the begining : our $dbh = dbConnect() or dbiError(); See I know (i'm

Re: performance coding project? (was: Re: When to cache)

2002-01-27 Thread Ged Haywood
Hi all, Stas has a point. Perl makes it very easy to do silly things. This is what I was doing last week: if( m/\b$Needle\b/ ) {...} Eight hours. (Silly:) if( index($Haystack,$Needle) m/\b$Needle\b/ ) {...} Twelve minutes. 73, Ged.

Re: performance coding project? (was: Re: When to cache)

2002-01-26 Thread Perrin Harkins
It all depends on what kind of application do you have. If you code is CPU-bound these seemingly insignificant optimizations can have a very significant influence on the overall service performance. Do such beasts really exist? I mean, I guess they must, but I've never seen a mod_perl

Re: performance coding project? (was: Re: When to cache)

2002-01-26 Thread Ed Grimm
On Sat, 26 Jan 2002, Perrin Harkins wrote: It all depends on what kind of application do you have. If you code is CPU-bound these seemingly insignificant optimizations can have a very significant influence on the overall service performance. Do such beasts really exist? I mean, I guess

Re: performance coding project? (was: Re: When to cache)

2002-01-26 Thread Sam Tregar
On Sat, 26 Jan 2002, Perrin Harkins wrote: It all depends on what kind of application do you have. If you code is CPU-bound these seemingly insignificant optimizations can have a very significant influence on the overall service performance. Do such beasts really exist? I mean, I guess

Re: performance coding project? (was: Re: When to cache)

2002-01-26 Thread Milo Hyson
On Saturday 26 January 2002 03:40 pm, Sam Tregar wrote: Think search engines. Once you've figured out how to get your search database to fit in memory (or devised a cachin strategy to get the important parts there) you're essentially looking at a CPU-bound problem. These days the best

Re: performance coding project? (was: Re: When to cache)

2002-01-26 Thread Stas Bekman
Perrin Harkins wrote: Back to your idea: you're obviously interested in the low-level optimization stuff, so of course you should go ahead with it. I don't think it needs to be a separate project, but improvements to the performance section of the guide are always a good idea. It has to

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread Issac Goldstand
Ah yes, but don't forget that to get this speed, you are sacrificing memory. You now have another locally scoped variable for perl to keep track of, which increases memory usage and general overhead (allocation and garbage collection). Now, those, too, are insignificant with one use, but

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread Stas Bekman
Issac Goldstand wrote: Ah yes, but don't forget that to get this speed, you are sacrificing memory. You now have another locally scoped variable for perl to keep track of, which increases memory usage and general overhead (allocation and garbage collection). Now, those, too, are

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread Rob Nagler
This project's idea is to give stright numbers for some definitely bad coding practices (e.g. map() in the void context), and things which vary a lot depending on the context, but are interesting to think about (e.g. the last example of caching the result of ref() or a method call) I

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread Perrin Harkins
The point is that I want to develop a coding style which tries hard to do early premature optimizations. We've talked about this kind of thing before. My opinion is still the same as it was: low-level speed optimization before you have a working system is a waste of your time. It's much

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread David Wheeler
On Fri, 2002-01-25 at 09:08, Perrin Harkins wrote: snip / It's much better to build your system, profile it, and fix the bottlenecks. The most effective changes are almost never simple coding changes like the one you showed, but rather large things like using qmail-inject instead of SMTP,

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread Matt Sergeant
On 25 Jan 2002, David Wheeler wrote: On Fri, 2002-01-25 at 09:08, Perrin Harkins wrote: snip / It's much better to build your system, profile it, and fix the bottlenecks. The most effective changes are almost never simple coding changes like the one you showed, but rather large things

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread Tatsuhiko Miyagawa
On Fri, 25 Jan 2002 21:15:54 + (GMT) Matt Sergeant [EMAIL PROTECTED] wrote: With qmail, SMTP generally uses inetd, which is slow, or daemontools, which is faster, but still slow, and more importantly, it anyway goes: perl - SMTP - inetd - qmail-smtpd - qmail-inject. So with going

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread David Wheeler
On Fri, 2002-01-25 at 13:15, Matt Sergeant wrote: With qmail, SMTP generally uses inetd, which is slow, or daemontools, which is faster, but still slow, and more importantly, it anyway goes: perl - SMTP - inetd - qmail-smtpd - qmail-inject. So with going direct to qmail-inject, your

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread Joe Schaefer
Stas Bekman [EMAIL PROTECTED] writes: I even have a name for the project: Speedy Code Habits :) The point is that I want to develop a coding style which tries hard to do early premature optimizations. I disagree with the POV you seem to be taking wrt write-time optimizations. IMO,

Re: performance coding project? (was: Re: When to cache)

2002-01-25 Thread Stas Bekman
Perrin Harkins wrote: The point is that I want to develop a coding style which tries hard to do early premature optimizations. We've talked about this kind of thing before. My opinion is still the same as it was: low-level speed optimization before you have a working system is a waste of

performance coding project? (was: Re: When to cache)

2002-01-24 Thread Stas Bekman
Rob Nagler wrote: Perrin Harkins writes: Here's a fun example of a design flaw. It is a performance test sent to another list. The author happened to work for one of our competitors. :-) That may well be the problem. Building giant strings using .= can be incredibly slow; Perl