8 messages in com.perforce.perforce-user[dumb] trigger performance [was Re: [...| From | Sent On | Attachments |
|---|---|---|
| Bennett, Patrick | 17 Feb 2004 05:19 | |
| Paul Goffin | 17 Feb 2004 05:36 | |
| Bennett, Patrick | 17 Feb 2004 05:42 | |
| G. Matthew Rice | 17 Feb 2004 06:29 | |
| Jeff Bowles | 17 Feb 2004 07:07 | |
| Alen Ladavac | 17 Feb 2004 09:12 | |
| Bennett, Patrick | 17 Feb 2004 10:57 | |
| Gary Sanders | 17 Feb 2004 11:00 |
| Subject: | [dumb] trigger performance [was Re: [p4] RE: What OS should I use on the server?]![]() |
|---|---|
| From: | Jeff Bowles (ja...@pobox.com) |
| Date: | 02/17/2004 07:07:44 AM |
| List: | com.perforce.perforce-user |
Let me see if I have this straight.
I wrote a simple trigger to show that triggers could do other things, put the scariest icon I could on it to make it clear that it was a performance-stealing nightmare included for a toy example, and people put it into production only to see it take an hour to do submits?
I can see that I need to really go back over those triggers. I knew they were old and needed a little touching up, but this is ridiculous.
(And all the time I put into finding that little scary-guy icon.)
To the guy asking about Windows versus Unix: reread Steve Vance's mail. He said, in effect, that case sensitivity issues might force you to Unix. The reason for this is that the Unix server doesn't hide case: if something's different, it's immediately noticed. (The way it's noticed is that files appear in other places, when submitted by a user who adds a new file in a directory that is already there (for a case-insensitive client) but not there (for a case-sensitive server). We can all agree that's less than lovely.)
To the folks wringing their hands about running "p4 files ..." from a trigger: I'll be rewriting that example in a short while, and will be the first to tell you that triggers should be miserly when calling "p4", caching data for calls inside the same trigger for the same changelist if possible, and using "p4 -Ztag" (or "p4 -G" inside Python, or Tony Smith's excellent p4ruby/p4perl add-ons) to get the more extensive output. (Run 'p4 -Ztag opened' for an example.)
One *ugly* hack: perhaps you might want to change your support and build systems, for certain directories, to look for a Makefile in any source directory. Writing a trigger that says, "if there's no Makefile in this directory he's adding a .cpp file to, don't let him add it." You can then, much more easily, write a simple "newsrcdir" script that adds the Makefile (and submits it) with an extra level of care.
That's one way. It's not "the right way", and not the only way. But it's an easy, non-performance-stealing approach that might serve as an example of yet another approach.
-Jeff Bowles




