Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Basic Coding Tips: Parsimonious Parameterization

by demerphq (Chancellor)
on Jan 29, 2005 at 10:26 UTC ( #426215=note: print w/replies, xml ) Need Help??


in reply to Re^2: Basic Coding Tips: Parsimonious Parameterization
in thread Basic Coding Tips: Parsimonious Parameterization

First, thanks for the link, thats an interesting site. :-) But i have to quibble a little with this particular example. Obviously the code posted in that link appears hokey. Not using pack/substr or vec for the index string strikes me as a little odd for instance. But the overall strategy represented there is not IMO that crazy. Consider that if you have large numbers of strings such a strategy can greatly reduce the overhead of storing it in perl. Each SV in perl represents a certain amount of space, for the sake of the discussion lets say 20 bytes, versus the 2 - 8 required by a representationg akin to the one mentioned. So if we are storing large numbers of strings this overhead can be quite burdensome. Also, by using such an approach you can grab a large chunk of memory at a single go instead of doing a large number of small allocations. (Its interesting (if a little obvious) to consider that if you have 100k null terminated strings you are using 100k to simply store the end of string point :-)

Anyway i didnt think such comments were worth posting on the site you linked to, but I do think its worth mentioning here.

---
demerphq

  • Comment on Re^3: Basic Coding Tips: Parsimonious Parameterization

Replies are listed 'Best First'.
Re^4: Basic Coding Tips: Parsimonious Parameterization
by Aristotle (Chancellor) on Jan 29, 2005 at 16:06 UTC

    Oh, I know well enough. In the case of that example though, the coder did so many other hokey things at once that it doesn't seem particularly likely that this was well-reasoned conscious choice.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://426215]
help
Chatterbox?
[stevieb]: it is exceptionally difficult I'm finding to debug a dist that is x-platform, where on each platform you're wrapping a different binary. Trying to co-ordinate a successful test run where tests are extensive is a nightmare, especially when the dist...
[stevieb]: ...you're testing is a test system itself. 10+ documented issues fixed, another half dozen found while fixing the original ones. I'm getting there...
[stevieb]: Then throw in changes to Windows that throws everything you trusted right out the window.
[shmem]: that's why it is called "Windows"

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2017-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (342 votes). Check out past polls.