News for hackers. Stuff that matters.
Re:Dropbox will kill your insane MacBook Air 2013 battery by jwr on Wednesday July 03, 2013 @05:28AM (#5983365)
Dropbox is terrible with CPU usage. This is something I reported to them several times, but it seems they don't really care.

Last I tested, Dropbox consumed CPU for ANY changes ANYWHERE in your filesystem, not just within the Dropbox folder. So its (slow) code processed changes even when you untarred a large set of files somewhere in /tmp.

I also stopped using Dropbox for storing my code because of that — it's nearly useless, as it consumes so much CPU and eats so much battery life, that it simply isn't worth the effort.

Another problem with Dropbox is that upon login it indexes the entire Dropbox, which if you have an HDD basically kills the machine for several minutes, e.g. you can't do anything else. That happens to me on a Mac Pro. On an SSD-equipped MacBook things are better, but it's still a monstrous operation.

And to everyone that says you should not store code in dropbox: a) there are good and legitimate reasons for doing so, b) dropbox could work a little more on optimizing CPU usage instead of adding "save your photos to Dropbox" features.

Re:Dropbox will kill your insane MacBook Air 2013 battery by davedx on Wednesday July 03, 2013 @06:04AM (#5983466)
> And to everyone that says you should not store code in dropbox: a) there are good and legitimate reasons for doing so

I'm genuinely curious: why do this, as opposed to using a DVCS like git?

Re:Dropbox will kill your insane MacBook Air 2013 battery by jwr on Wednesday July 03, 2013 @07:25AM (#5983775)
I do use git. But I often develop on two machines: a laptop and a Mac Pro. Which means I am often in the middle of something when I have to just pick up the laptop and go. "In the middle of something" means that just pushing commits over doesn't cut it. I can (and do) rsync stuff over, but that is annoying and very error-prone (it's too easy to sync stuff the other way around and lose work).

I guess you could say Dropbox gives me finer sync granularity than git does.

Dropbox seems like a perfect solution: have a single place where you keep code, develop on two machines, just pick up your laptop and leave whenever you want, without worrying about sync.

Re:Dropbox will kill your insane MacBook Air 2013 battery by timtadh on Wednesday July 03, 2013 @07:55AM (#5983889)
I don't understand. You can easily cut a branch commit. Push the branch. Pull the branch finish it. Commit. (optionally rebase). Delete the temporary branch. Git handles this problem very well.
Re:Dropbox will kill your insane MacBook Air 2013 battery by jwr on Wednesday July 03, 2013 @08:24AM (#5984026)
Right. I get a call, I need to leave for a meeting in 5 minutes. This is exactly the time when I want to cut branch commits, push branches, pull branches, commit and rebase. Even rsync is better than that.

Put it another way, I don't understand why you'd use Dropbox at all, after all you could easily version all your files in git, using push/pull/branch/commit/rebase to get your data to your different machines. Git handles this problem very well, after all.

Re:Dropbox will kill your insane MacBook Air 2013 battery by snowwrestler on Wednesday July 03, 2013 @10:57AM (#5984922)
The specific problem with git in Dropbox is that working in git can cause a large number of transient files changes as you, for example, switch branches. Dropbox doesn't know those are transient changes and attempts to sync all of them. That is one reason it can drain battery so fast.

Obviously with regular files, that is not an issue, so Dropbox works well. (unless you're managing them with git, I guess)

If you're willing to accept the "lightness" of git branching and commits, it's possible to "save and sync" your work very quickly. Assuming you're on a dev branch:

git add -A

git commit -m "temp commit 2013-7-3"

git push origin

You can even script this, see for example:

http://stackoverflow.com/questions/8482843/git-commit-bash-s...

Then when you're ready to work on a different machine, you fetch from origin.

If you want to keep your commits meaningful on your dev branch, you can create a temp branch first, then rebase later to get rid of the ugly temp commit.

git checkout -b temp123

Re:Dropbox will kill your insane MacBook Air 2013 battery by timtadh on Wednesday July 03, 2013 @10:26AM (#5984698)
I don't use dropbox at all? To me it is a great solution for consumers but my needs are different. I use git + standard unix tools. For backup I use tarsnap. It rocks.
Re:Dropbox will kill your insane MacBook Air 2013 battery by jasonlotito on Wednesday July 03, 2013 @08:06AM (#5983944)
You don't understand or you didn't spend ti e thinking about that. It's doing all those steps, or doing nothing and achieving the same result. Not sure what you don't understand.
Re:Dropbox will kill your insane MacBook Air 2013 battery by StavrosK on Wednesday July 03, 2013 @08:01AM (#5983919)
My use case: The "extras" (files not in the DVCS like libraries, dependencies, etc) are just as important for working, but they take too long to transfer/update from one PC to the other, especially for things like GAE which don't have easy ways to manage.

Dropbox could help there, but it does not.

Re:Dropbox will kill your insane MacBook Air 2013 battery by ajuc on Wednesday July 03, 2013 @09:04AM (#5984212)
I use both dropbox and git for my home projects. I sometimes develop on my desktop, sometimes on my wifes laptop, and sometimes remotely on another server through ssh, and I don't want to commit/add stuff to the git index just because I move from one computer to another. I could do this with branches, but it's too much hassle when I just want to shut down computer.

So I work on a directory that is in dropbox, and in git, and I can instantly shutdown my PC and start writing code on the laptop. Commiting changes is a separate step. It's quite convenient. Also I can test the code by accessing dropbox public link (it's mostly javascript and static websites), and there's no separate "deploy" step - when I save a file on any computer the change is ready to be tested, always at the same place. With git I would need to remember to commit, and update before I test, or I would need to set up a test server on every computer, and depending on where I work I would need to access different address. The difference between 15 seconds and 0 seconds to test small change is VERY significant.

Re:Dropbox will kill your insane MacBook Air 2013 battery by robryan on Wednesday July 03, 2013 @06:16AM (#5983508)
As opposed to there probably aren't really good reasons. Doing it in addition to source control seems like something everyone should do though.

The way people generally use source control isn't to push every single line added or changed to a remote copy of the repo as soon as it is done. A commit is more tied to completing a task, you need something else to cover you for loss for smaller amounts of code than that if your computer dies.

Re:Dropbox will kill your insane MacBook Air 2013 battery by dhimes on Wednesday July 03, 2013 @08:40AM (#5984103)
This is apparently the subject of some debate.

More specifically to me, it depends on what branch I'm on. If I'm on dev, I have no problem with big commits. (For features I'll often set a bookmark [hg]- maybe even clone and work from the clone if it's risky).

But if I'm on test or hotfixing on stable, I use very small commits so that I can easily graft (backport) back to dev.

But at the very least I have more than one commit message like -FIX blah blah commit so can get from <name of other machine>

Re:Dropbox will kill your insane MacBook Air 2013 battery by Wintamute on Wednesday July 03, 2013 @08:40AM (#5984106)
My entire work folder is inside my Dropbox. Most of those projects are under Git version control, other temporary folders, toy projects and bits and bobs are not. This way my work folder is nominally backed up and synced across my machines. I wouldn't advocate using Dropbox as the only/primary backup and version control for important projects, but its totally legitimate to have code inside of a Dropbox.
Re:Dropbox will kill your insane MacBook Air 2013 battery by nicoschuele on Wednesday July 03, 2013 @09:27AM (#5984329)
My point exactly.
Re:Dropbox will kill your insane MacBook Air 2013 battery by columbo on Wednesday July 03, 2013 @07:49AM (#5983866)
I use dropbox as a client facing equivalent of FTP.

That way the client can have programmers/designers change their UI without needing any access into the server. It also allows me to share each site and doesn't bring the entire headache of managing accounts. I simply share the yoursite.com folder to the client. If a client has multiple sites it's just as easy to share all of them.

Re:Dropbox will kill your insane MacBook Air 2013 battery by stinos on Wednesday July 03, 2013 @06:12AM (#5983495)
same question here. If you can get free private git repositories on services like bitbucket, it's sort of a mystery to me why one would want to lose true versioning and go with plain backup instead.
Re:Dropbox will kill your insane MacBook Air 2013 battery by snom380 on Wednesday July 03, 2013 @06:27AM (#5983549)
You can have both. If you put your working directory in Dropbox you will have a copy of your uncommitted work as well.

Also, in many cases it is easier for a graphic designer or just a customer to put stuff in a Dropbox folder that will sync to their website, than uploading stuff using a web form or learning to use git and X amount of deployment tools.

Re:Dropbox will kill your insane MacBook Air 2013 battery by rickyc091 on Wednesday July 03, 2013 @06:35AM (#5983576)
I'm part of the camp that uses both Dropbox / Git for my development work. I've actually had Dropbox save me a few times due to nasty rebases. For a lot of one off scripts, I don't really commit them into git so that's where it comes in handy. The extra redundancy doesn't hurt...
Re:Dropbox will kill your insane MacBook Air 2013 battery by duncan_bayne on Wednesday July 03, 2013 @07:21AM (#5983760)
> The extra redundancy doesn't hurt...

... unless you're running on batteries.

Re:Dropbox will kill your insane MacBook Air 2013 battery by snom380 on Wednesday July 03, 2013 @06:23AM (#5983529)
One advantage is near-instant sync between many computers. With a VCS you have to push and pull manually or set up some complicated cron jobs to automate it.
Re:Dropbox will kill your insane MacBook Air 2013 battery by SurfScore on Wednesday July 03, 2013 @07:20AM (#5983754)
Dropbox revert to previous versions has saved my ass multiple times when something goes wrong in Xcode that I can't undo.
Re:Dropbox will kill your insane MacBook Air 2013 battery by fredoliveira on Wednesday July 03, 2013 @07:25AM (#5983772)
Xcode has built-in git support which you should use.
Re:Dropbox will kill your insane MacBook Air 2013 battery by SurfScore on Wednesday July 03, 2013 @07:36AM (#5983823)
I'm talking weird glitches like a nib gets corrupted and I've made enough changes to matter but haven't committed anything yet
Re:Dropbox will kill your insane MacBook Air 2013 battery by 501 on Wednesday July 03, 2013 @08:21AM (#5984012)
That sort of glitch sounds like the kind of thing Dropbox does (did?) from time to time because it's not aware of bundles. (For those unaware, on OS X many files are actually folders, eg: http://en.wikipedia.org/wiki/Rich_Text_Format_Directory)
Re:Dropbox will kill your insane MacBook Air 2013 battery by cones688 on Wednesday July 03, 2013 @06:20AM (#5983515)
> Another problem with Dropbox is that upon login it indexes the entire Dropbox

I haven't used Dropbox in a while as a local client for other reasons but I think people need to appreciate this is the payoff for having the convenience? How can one expect it to sync changes if it never scans or detects changes? People seem to want a magical product where it never uses any HD throughput or CPU to index/scan/upload megabytes of data, sure it can look for changes less often but that decreases the usefulness of the product.

As a sidenote, surely all the dropboxers use dropbox for everything (they have unlimited accounts) so they must be 100% aware of this? in which case there must be concrete reasons for this!?

Re:Dropbox will kill your insane MacBook Air 2013 battery by jwr on Wednesday July 03, 2013 @07:28AM (#5983786)
I am not saying Dropbox sucks, I am just criticizing those aspects which I think could be improved and are being neglected.

From my conversations with Dropbox support I understood that Dropbox really can't handle a large number of small files. The large plans are intended for people who store large files, not lots of stuff.

Re:Dropbox will kill your insane MacBook Air 2013 battery by tokenizerrr on Wednesday July 03, 2013 @07:07AM (#5983702)
Well, just my 2 cents...

The indexation doesn't need to happen immediately upon boot. Do one directory every minute or so, let the computer start up and do other things while your background task runs.

Changes are detected because the operating system notifies dropbox of changes made, they're not continuously scanning the drive. From other comments it sounds like dropbox has registered a hook like that for the entire filesystem, instead of just the working folder. That seems unnecessary.

Re:Dropbox will kill your insane MacBook Air 2013 battery by mikevm on Wednesday July 03, 2013 @07:21AM (#5983759)
My computer comes to a halt on boot because of the Dropbox client. I hate it. For some reason SugarSync does not do this kind of thing, so there has to be a way to do it in a smarter way.

Why can't Dropbox remember the state of the files in your dropbox folder, and upon login, grab state of the files on the Dropbox server and do a simple comparison, without re-calculating hashes for the files on your computer?

Re:Dropbox will kill your insane MacBook Air 2013 battery by nitrogen on Wednesday July 03, 2013 @07:35AM (#5983822)
Your files may have changed between logins (multi-user system, multi-OS system, etc.).
Re:Dropbox will kill your insane MacBook Air 2013 battery by mikevm on Wednesday July 03, 2013 @09:42AM (#5984407)
In that case, you can look at the modified date first. Better than re-calculating hashes.

I guess the methods I propose will not guarantee proper syncing if for some reason a file has changed but the metadata hasn't...

Re:Dropbox will kill your insane MacBook Air 2013 battery by nitrogen on Wednesday July 03, 2013 @07:15PM (#5988114)
A hashing/checksumming filesystem would make it possible to determine whether a file's contents have changed without reading the file. The burden of computing the checksum is then shifted to writing, which in theory occurs once per sync in the case of Dropbox. This burden is merely computational, rather than a complete disk I/O burden imposed by hashing the file when Dropbox restarts.
Re:Dropbox will kill your insane MacBook Air 2013 battery by wslh on Wednesday July 03, 2013 @07:26AM (#5983776)
So, we need a per application battery usage indicator? Surely this application exists.
Re:Dropbox will kill your insane MacBook Air 2013 battery by Terretta on Wednesday July 03, 2013 @07:50AM (#5983871)
It's in beta, coming this fall: Mavericks.

The new battery indicator on the menu bar identifies apps that consume the most energy, and Activity Monitor now details energy consumption per process.

First in list of features: https://developer.apple.com/osx/whats-new/

Re:Dropbox will kill your insane MacBook Air 2013 battery by streeter on Wednesday July 03, 2013 @12:03PM (#5985433)
Anyone running Mavericks seen what it says for Dropbox? I've seen reports for Chrome and Safari, but not Dropbox yet.
Re:Dropbox will kill your insane MacBook Air 2013 battery by wslh on Wednesday July 03, 2013 @09:12AM (#5984248)
On Windows? I can't find one.
Re:Dropbox will kill your insane MacBook Air 2013 battery by hnha on Wednesday July 03, 2013 @08:18AM (#5983996)
on Linux there is powertop, awesome piece of libre software by Intel