repos $ du -hc $(ls */lib/*.jar) | fgrep total
291M    total

Cost (on standard disks): < 5 cents.

Sorry, that's tiny. It's even less than 0.5% of the small SSD I have in
my laptop.

Seriously, this is just premature optimization.

You're seriously fine with every single Leiningen-based project spitting a redundant copy of Clojure, contrib, and whatever other dependencies it needs onto disk, and doing so every time it picks up a new snapshot? That every tiny library you pull off GitHub grabs another few dozen MB, rather than a few dozen KB?

290MB is only tiny if you have an empty disk. 290MB here, 290MB there, and suddenly the 13GB free on my 180GB laptop disk starts looking mighty cramped. I have a lot of stuff I'd rather store on that disk than 290MB of redundant jar copies. Those hundreds of megs get backed up, scanned, indexed, defragmented, yadda yadda. What a waste.

You might also be overlooking disk caching, paging, JVM memory sharing, and other performance effects from having multiple instances of the same jars in memory. I know that the Mac JVM does some tricks to share memory in this way.

Furthermore, it's slower to copy 28MB of jars than it is to symlink them:

$ time cp -R lib /tmp/foo

real    0m2.981s
user    0m0.007s
sys     0m0.152s

... surprise disk slowdown! All the nonsense of looking up snapshots, checking deps against the Maven repo, etc. already takes so much time that I dislike using Leiningen. Anything to bring that down by a few hundred milliseconds and a few fewer disk head slaps would be nice.

There is no engineering reason to blindly copy jars into lib/. Hard links, symlinks, or computed classpaths are all better solutions in every single way.

"Premature optimization" is the act of expending significant time addressing a performance problem prior to measurement, typically allowing unmeasured performance concerns to affect system design. Using symlinks instead of copying would not be a significant amount of work, doesn't affect the overall design, and we're hardly flying blind. You're using the wrong phrase. Here's a different Knuth quote:

"In established engineering disciplines a 12 % improvement, easily obtained, is never considered marginal and I believe the same viewpoint should prevail in software engineering"

I'd call this a decent improvement, and it's certainly easily obtained.

Whatever happened to engineers building a decent solution out of a sense of pride, or even making the most basic half-assed attempt to conserve resources?

Sometimes I despair.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to