Re: Random Unique ID
| From: | Németh Zoltán | Date: | Fri, 23 Mar 2007 19:26:04 +0000 |
| Subject: | Re: Random Unique ID | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251217@lists.php.net to get a copy of this message | ||
2007. 03. 23, péntek keltezéssel 15.13-kor tedd ezt írta:
> At 9:15 AM +0100 3/23/07, Németh Zoltán wrote:
> >2007. 03. 22, csütörtök keltezéssel 12.58-kor tedd ezt írta:
> >> At 4:53 PM +0100 3/22/07, Németh Zoltán wrote:
> >> >2007. 03. 22, csütörtök keltezéssel 11.42-kor tedd ezt írta:
> >> >
> >> > > As for efficiency, that's probably not
> >>even worth mentioning in this case.
> >> >
> >> >why not? you would use 2 sql queries while I would use one most of the
> >> >time and 2 in case of already reserved ID - that is almost twice as much
> >> >processor time
> >> >that may count much if the routine is used frequently
> >>
> >> Go ahead, try it, and tell me how much time it cost.
> >>
> >> From experience, there are things one can spend
> >> their time optimizing and there are other things
> >> that one should be able to see that aren't worth
> >> pursing.
> >>
> >> I've been wrong before, but you're open to
> >>prove me wrong again, if you like.
> >
> >okay, I've got up earlier and made a little benchmark. The result
> >suprised me, and proved you right. ;)
>
> Németh:
>
> Thanks for trying, but I said what I did because
> I knew from experience that these types of
> actions are blinding fast and getting faster all
> the time.
>
> I'm not suggesting to dispense with looking for
> less operations, but sometimes the effort doesn't
> exceed other benefits in readability, easier
> logic, simpler code, and time spent developing
> code. We have been rather slow to realize changes
> the speed and memory of hardware.
>
> For example, we recently had a discussion on the
> difference between using "<?" as compared to
> "<?php" and the additional text was mentioned as
> a "concern". When in fact, if is of no noticeable
> or significant concern at all. It's like
> discussing a grain of sand on the beach.
>
> Not that you did this, but sometimes it's best to
> figure out what's important and what's not before
> making it an issue.
yeah, you're right again :)
(however my first name is still Zoltán instead of Németh ;) )
that's what I did now. I figured out it's not important. thanks for
inspiring me to do that :)
greets
Zoltán Németh
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com
> http://ancientstones.com ×`%¹x+ /
> ‡;hx/http://earthstones.com
>