Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
more useful options
 
PerlMonks  

Re: Efficient coupling/decoupling of serialized data

by samtregar (Abbot)
on Jun 24, 2002 at 17:04 UTC ( #176858=note: print w/ replies, xml ) Need Help??


in reply to Efficient coupling/decoupling of serialized data

Why deserialize it at all? Just treat it as a number. If the serial is <= the current YYYYMMDD01 then you know that at least a day has passed, so replace it. If not then ++ the serial. It's always faster not to parse at all!

-sam


Comment on Re: Efficient coupling/decoupling of serialized data
Re: Re: Efficient coupling/decoupling of serialized data
by PrakashK (Pilgrim) on Jun 24, 2002 at 22:02 UTC
    ++ the serial
    Just as long as there are no more than 99 versions in a day.

    /prakash

    Update: Of course, your numbering scheme itself breaks if there are more than 99 versions, so my comment above is not really valid.

      Nothing terrible happens if there are, it just rolls to the next day. 2002010199 becomes 2002010200. The algorithm still works - it's just the humans that get nervous about having a serial number of 2002010200 on Jan 1, 2002.

      -sam

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://176858]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-04-18 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls