News for hackers. Stuff that matters.
Re:Why git is so fast (or why Java is not as fast as C) by axod on Saturday January 02, 2010 @05:34AM (#1027063)
Agree. If your bottleneck is your source control tool, you're doing something wrong.
Re:Why git is so fast (or why Java is not as fast as C) by JulianMorrison on Saturday January 02, 2010 @06:19AM (#1027091)
Speed changes your workflow. With slow or fussy source control, you're more likely to do "branches" by just not checking in your changes for awhile. With near-instant source control, you don't feel burdened by making a feature branch, switching, editing and committing a few times, and merging back.
Re:Why git is so fast (or why Java is not as fast as C) by axod on Saturday January 02, 2010 @07:23AM (#1027133)
True, I don't really like using branching/merging as a workflow unless absolutely necessary. So sure, if you're constantly branching and merging all day, then I can see it being a problem. But I'm not convinced branching+merging is really good for your productivity.

The other point is that with a distributed system like git, all of the load is on your local machine. With a centralized system like subversion, the server could do the heavy lifting (Wether this happens in practice is another matter). My point is, if you want lightening fast rev control for some reason, probably better to not use distributed.

Re:Why git is so fast (or why Java is not as fast as C) by silentbicycle on Saturday January 02, 2010 @09:03AM (#1027203)
The flip side is that, with most VC systems, queries about changes or repository history have network latency added. The feedback is near-instant from distributed systems, which keep their info locally. I find it makes a tremendous difference when, say, bisecting an error.
Re:Why git is so fast (or why Java is not as fast as C) by DougBTX on Saturday January 02, 2010 @09:35AM (#1027237)
But I'm not convinced branching+merging is really good for your productivity.

Because branching and merging are slow? I can see this argument getting stuck in something of a rut.

Re:Why git is so fast (or why Java is not as fast as C) by axod on Saturday January 02, 2010 @11:56AM (#1027356)
No. I prefer to keep things simple, always make sure the source builds, and just develop linearly where possible. I think it makes for cleaner workflow.
Re:Why git is so fast (or why Java is not as fast as C) by JulianMorrison on Saturday January 02, 2010 @12:15PM (#1027381)
The advantage of having lots of small branches is that you isolate work. You never have the problem of wanting to fix a bug or add some small feature, but having the code all in a mess halfway through a major reorganization.

Also it's a lot easier to try something experimental on a branch. If it works, merge it in. If it fails, abandon the branch.

Git makes branching and merging fast enough that using them as the default workflow makes sense.

Re:Why git is so fast (or why Java is not as fast as C) by axod on Saturday January 02, 2010 @12:49PM (#1027411)
Yeah I just don't work that way. I work linearly :/
Re:Why git is so fast (or why Java is not as fast as C) by dasil003 on Saturday January 02, 2010 @02:04PM (#1027510)
What type of work do you do that you never have urgent bug fixes and/or never have features that take more than a day to complete?

Sure it's optimal to work linearly, but in the real world things come up. Now if you are looking for a reason to tell stakeholders to suck it up and wait, then poor branching support may help you, but that's a technical solution to a managerial problem. If you're interested in having the most flexibility to solve real world problems, then git's power is indispensable. Hell, you can work linearly all the time, and retroactively convert anything into a branch. Even if you don't need branches. Even if you are the sole developer.

Sorry if that's a little harsh, but statements like "My point is, if you want lightening fast rev control for some reason, probably better to not use distributed." smack of willful ignorance. Go use git for a while and then come back and try to say that with a straight face.

Re:Why git is so fast (or why Java is not as fast as C) by axod on Saturday January 02, 2010 @03:15PM (#1027592)
I have many features that take more than a day to complete, but I prefer to do them in such a way that it doesn't break other stuff. That's just the way I prefer to work. If I'm working through a big arch change, I'll do it in sections, each time making sure everything builds and works and is sane. I checkin often, once I hit something that builds+works.

That's just the way I work.

Similarly, I don't use threads in programs unless I absolutely categorically have to. It's a similar sort of thing. Call me crazy :/

I did use git for a bit, and thought 'meh'. It didn't solve any real world problem I had.

Re:Why git is so fast (or why Java is not as fast as C) by tentonova on Saturday January 02, 2010 @03:01PM (#1027573)
What type of work do you do that you never have urgent bug fixes and/or never have features that take more than a day to complete?

I've always worked to constrain non-linear development to the absolute minimum required because the technical costs are easily dwarfed by the human communication overhead and inherent organizational complexity engendered in multiple disparate branches of development.

Re:Why git is so fast (or why Java is not as fast as C) by kscaldef on Saturday January 02, 2010 @04:58PM (#1027730)
This still feels like the sort of statement that comes from having not worked with a (D)VCS that does branching well. There is no "inherent organizational complexity" in me having a private branch that I share with no one and which is only used for an hour or two while I work on a critical bug fix.

What you're talking about seems to be multiple, long-running development or release branches. Those are hard to manage and generally a bad idea in any VCS. But, with a system like Git, you don't tend to have long-lived divergent development branches. Typical branch lifetimes are more like hours or days, rather than weeks or months. There are exceptions, but by-and-large, branches are just used differently in git.

Re:Why git is so fast (or why Java is not as fast as C) by tentonova on Sunday January 03, 2010 @01:09AM (#1028273)
This still feels like the sort of statement that comes from having not worked with a (D)VCS that does branching well.

I've worked with both git and hg.

There is no "inherent organizational complexity" in me having a private branch that I share with no one and which is only used for an hour or two while I work on a critical bug fix.

What's the value of this private branch beyond simply committing to the actual branch?

If it's just a bug fix, how big can it be?

If it's more than a bug fix, why am I hiding this code from the team by implementing it on a private, local, non-backed up, non-code-reviewed, non-centralized branch?

Typical branch lifetimes are more like hours or days, rather than weeks or months. There are exceptions, but by-and-large, branches are just used differently in git.

Why wouldn't I just commit this work incrementally to the actual upstream branch, rather than hiding it for "hours or days" from the rest of the team?

Re:Why git is so fast (or why Java is not as fast as C) by kscaldef on Sunday January 03, 2010 @01:19PM (#1028785)
Reading this comment and your other comments in this discussion, I think you have some issues which have nothing to do with what version control system is being used. While you keep talking about "hiding code" and "hindering communication" and "cowboy coding", I think about keeping the history of our codebase well-organized so that you can understand the evolution of a single feature, so that commits are logically ordered, so that unrelated changes don't get lumped together because it was the easy thing to do.

To quickly comment on a couple of your other concerns, my local hard-drive is backed up, so that's irrelevant; and I personally feel that code review at the level of individual commits has very little value, and you should instead be reviewing complete feature implementations.

Re:Why git is so fast (or why Java is not as fast as C) by dasil003 on Saturday January 02, 2010 @04:57PM (#1027728)
Of course, but that's irrelevant to the utility of git branches. In subversion, yes, you don't go through the hassle of creating a branch for all these reasons. In git though, branches are most commonly used within one developer's workflow. The vast majority of branches are never seen by more than one developer, they are simply an organizational tool to be used at your discretion without imposing any overhead on anyone unless you have good reason to.
Re:Why git is so fast (or why Java is not as fast as C) by tentonova on Sunday January 03, 2010 @01:14AM (#1028278)
In subversion, yes, you don't go through the hassle of creating a branch for all these reasons.

svn cp ^/trunk ^/branches/tentonova-bugfix-x

svn co ^/branches/tentonova ~/branch

I wouldn't call this a technical "hassle", and I'm not sure what organizational issues would arise here.

The vast majority of branches are never seen by more than one developer, they are simply an organizational tool to be used at your discretion without imposing any overhead on anyone unless you have good reason to.

Hiding your development branches on a shared codebase often incurs either communication overhead, or the costs of lack of communication.

Re:Why git is so fast (or why Java is not as fast as C) by dasil003 on Sunday January 03, 2010 @12:29PM (#1028709)
I wouldn't call this a technical "hassle", and I'm not sure what organizational issues would arise here.

Merging.

Hiding your development branches on a shared codebase often incurs either communication overhead, or the costs of lack of communication.

If you're using the limitations of your VCS to manage team communication then you have bigger problems. The obvious analog to the "problem" you mention is people not checking in code because it's not ready yet. Maybe you think this is better because you only want deployable software in your main branch, but for large features that makes the history opaque and leaves your developer effectively without any of the benefits of version control while they are working on the large feature.

Frankly, a lot of the arguments against DVCS smack of the same sort of ignorance that the Java zealots were leveraging against Ruby back when Rails started picking up steam in 2005/2006. There's this fear that powerful features will lead to chaos and are in effect too powerful to be used safely. And the reality is that yes, in environments truly incompetent programmers work, there's definitely a strong argument to be made for limiting the damage they can do. But I think the past few years have borne out the fact that mediocre and merely-competent programmers can make strong use of these tools without leading to disaster.

Re:Why git is so fast (or why Java is not as fast as C) by tentonova on Sunday January 03, 2010 @12:53PM (#1028746)
Merging.

Subversion 1.5, released in June of 2008, supports merge tracking.

If you're using the limitations of your VCS to manage team communication then you have bigger problems.

A simple but sufficiently powerful solution leads to simplified communication. If you're using the complexity of your VCS to hinder team communication and support cowboy coding, then you have bigger problems.

Frankly, a lot of the arguments against DVCS smack of the same sort of ignorance that the Java zealots were leveraging against Ruby back when Rails started picking up steam in 2005/2006 ... But I think the past few years have borne out the fact that mediocre and merely-competent programmers can make strong use of these tools without leading to disaster.

Nobody (intelligent) said there'd be disaster because of the "powerful features", just that operating in that manner would be more expensive than the much simpler alternatives.

Expending more effort with more powerful tools isn't actually an improvement, it's just busy-work -- constantly working on your muscle car instead of driving it.

Re:Why git is so fast (or why Java is not as fast as C) by dasil003 on Sunday January 03, 2010 @07:49PM (#1029436)
If you're using the complexity of your VCS to hinder team communication and support cowboy coding, then you have bigger problems.

This is a blub attitude plain and simple.

Re:Why git is so fast (or why Java is not as fast as C) by prodigal_erik on Sunday January 03, 2010 @01:52AM (#1028309)
We do that, and I will say that svnmerge.py doesn't work very well with older versions of svn. A common failure mode is when you merge from trunk to rebase a dev branch and find a conflict, your edits to resolve it are automatically ignored and not reflected back to trunk, and any overlapping edits you make later will eventually cause new conflicts when you finally go to trunk.

Apparently the new svn:mergeinfo property helps, but we haven't migrated at work so I don't know how well.

Re:Why git is so fast (or why Java is not as fast as C) by Deestan on Saturday January 02, 2010 @06:43AM (#1027116)
Anything that is part of the programming routine should be severely optimized.

Every little bit not only adds up, it often multiplies in big enough projects.

In one of our big products, we have several build steps that touch upon the source control systems. 10 second VCS delay X 6 build steps, 1 second lazily written c++-header slowdown X 300 files, etc. and before you know it something that should take 10-15 minutes for a clean build now takes ~1 hour. True story. :(

Luckily, enough of us got so annoyed about this that it got fixed after a few weeks of dedicated effort. We now have a constant conscious effort to keep build times down.

Re:Why git is so fast (or why Java is not as fast as C) by gvb on Saturday January 02, 2010 @09:46AM (#1027250)
As Deestan notes, delays have direct multipliers. Beyond that, delays often have indirect multipliers that are even worse.

XKCD "Compiling" http://xkcd.com/303/ is funny because we have all done it. If there is a noticeable lag in a development step (VCS operations, compiling, running the program, etc.), it is very likely that the developer will lose concentration and switch to reading email, browsing HN, reading /., BSing with co-workers, etc.

This takes the direct delays and turns them into exponential multipliers. The result is that 30 seconds of lag has a high risk of becoming 30 minutes of wasted time.

Re:Why git is so fast (or why Java is not as fast as C) by berntb on Saturday January 02, 2010 @09:10AM (#1027210)
Thank you for reminding me about compilation time.

Now I won't be tempted to go back from scripting language country for a few more years... :-)

Edit: I should add that I have very fond memories about my youth and C, too.

Re:Why git is so fast (or why Java is not as fast as C) by mrkurt on Saturday January 02, 2010 @12:02PM (#1027369)
Most sane projects I've experienced do "builds" even with scripting languages. It's every bit as much of an annoyance to have a bunch of needlessly slow tests as it is to deal with slow compile times.
Re:Why git is so fast (or why Java is not as fast as C) by berntb on Saturday January 02, 2010 @01:11PM (#1027448)
OK, a point; the pain with compiling languages is the compile cycle where you edit-and-run just local tests, not for the whole system.
Re:Why git is so fast (or why Java is not as fast as C) by ido on Saturday January 02, 2010 @11:11AM (#1027317)
C++ compiles much slower than many other popular compiled languages, and the more of its "fancy" features you use the slower it compiles.

C & Java for example both compile much faster than c++.

Re:Why git is so fast (or why Java is not as fast as C) by DougBTX on Saturday January 02, 2010 @05:49AM (#1027068)
Discussing bottlenecks oversimplifies, it assumes everything goes down one pipeline. Small changes can make big differences. If your tool feels a little bit snappier, you might make two commits instead of one, then six months down the line someone saves half an hour tracking down a bug because the blame messages are more relevant.