Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Random Top Nodes (nice)

by tye (Sage)
on Feb 08, 2004 at 05:58 UTC ( #327428=note: print w/replies, xml ) Need Help??

in reply to Random Top Nodes

I like the idea. It may be quite a bit more efficient to compute the XP cut-off nightly (when $NORM is computed and votes are handed out) so the DB can throw out nodes as it scans instead of having to sort them all in order to find the top 1000 (is MySQL smart enough to use a limited-size heap for such?). Yes, even the current non-random listings could probably benefit from such a change.

Then there is the risk of people reloading the page over and over to get different samples and the DB load of such. Probably worth trying after I work out the current web server performance issues that caused me to roll back the DB performance stats gathering...

Perhaps Best Nodes should only list best of year, best of month, best of week, and best of day while a separate node lists a random selection of all-time best nodes.

- tye        

Replies are listed 'Best First'.
Re: Re: Random Top Nodes (nice)
by liz (Monsignor) on Feb 08, 2004 at 14:01 UTC
    ...while a separate node lists a random selection of all-time best nodes.

    I would be for that. And I think that could be done rather cheaply by just determining the top 1000 nodes of all time only once a day or so. If it were plain mod_perl, I would just store the id's of those 1000 in an array at a server start time (before forking) and randomly select from that from memory without ever touching the disk. It would only make startup a little longer, but would not affect runtime in general.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://327428]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2018-06-23 16:32 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.