A preview of new log and compare functionality in v0.13

Posted in Miscellaneous, Status Update on October 30th, 2009 by Adam Plumb – 8 Comments

For me, and I think for a lot of other people, one of the key missing pieces of functionality for RabbitVCS v0.12 is robust support for comparing files, folders, and revisions; so this is the first thing I started working on for v0.13.  So far, I’ve updated the log viewer and created a new dialog devoted to comparisons, but I’ll be improving context menu functionality throughout all dialogs.  Here is a video preview of the new log view functionality and the compare dialog.

VN:F [1.9.7_1111]
Rating: 4.8/5 (6 votes cast)

The RabbitVCS Project as seen by CodeSwarm

Posted in Miscellaneous on October 17th, 2009 by Adam Plumb – Be the first to comment

Today, I happened upon the code_swarm project, which allows you visualize your project’s development over time.  One of the neatest things about it does everything from your repository’s log.  Here is what code_swarm spit out for RabbitVCS.  Pretty cool…

VN:F [1.9.7_1111]
Rating: 4.0/5 (4 votes cast)

See RabbitVCS v0.12 in action

Posted in Miscellaneous on October 7th, 2009 by Adam Plumb – 1 Comment

I’ve posted some videos of RabbitVCS in action on Youtube.  Here is the first of the series, checking out a simple working copy from a repository.

VN:F [1.9.7_1111]
Rating: 4.0/5 (2 votes cast)

The envisioned overall architecture

Posted in Miscellaneous on May 8th, 2009 by Bruce van der Kooij – 1 Comment

I just created this diagram of the envisioned overall architecture of NautilusSvn and thought it would be useful to share. It doesn’t completely represent the currently implemented architecture though it is quite close.

Overall architecture of NautilusSvn

The D-Bus service consists out of a status monitor which uses inotify to monitor the filesystem and a status cache to speed up status requests etc. The status monitor will notify all registered clients of any interesting actions, so information is pushed to clients. Note that it may be possible for clients to use the VCS abstraction layer directly and not have to pass through the D-Bus service if they so prefer.

VN:F [1.9.7_1111]
Rating: 4.7/5 (6 votes cast)

File access times and caching

Posted in Miscellaneous on May 8th, 2009 by Bruce van der Kooij – 1 Comment

I’ve been hanging around the Nautilus IRC channel for quite a few years already and have gotten quite familiar with the devs. Every single one of them is a great individual and always willing to lend a helping hand.

I thought I’d ask Alexander Larsson, a Red Hat employee and the lead developer for Nautilus and other projects including GVFS, for his insights as to why initial status checks take so much longer than consecutive ones. I already had a general idea as to why (mostly the idea of caching) but was not familiar with the details and quite interested in the opinion of somebody I consider a true expert.

The resulting answer was so informative I just had to take the time to share it with all of you. Here’s how Alex explained it:

Well, you know about caching I suppose? At this point we’re talking about the kernel using spare RAM to keep information about whats on the disk.

Say you start with a blank slate, i.e. you have not accessed the filesystem at all. Now say you run stat(“/some/dir/file”). First the kernel has to find the file, which in technical terms is called the inode. It starts by looking in the filesystem superblock, which stores the inode of the root directory. Then it opens the root directory, finds “some”, opens that, finds “dir”, etc. eventually finding the inode for file.

However, on a second access to /some/dir/file it uses the “dcache” (directory cache) which keeps around a set of recently accessed paths like /some, /some/dir, and /some/dir/file. So, it can now find the inode without any disk I/O.

Then you have to actually read the inode data. After first read this is also cached in RAM. So, a read only has to happen once.

I interupted Alex for a moment to ask him how long entries are maintained in the cache.

It depends on what else the system is doing. If you actually start reading the file data, that is also cached (unless you hint the kernel not to do it). In general Linux tries to use all memory that is not otherwise allocated for cache and has a form of least recently used policy for what to throw out. So, if there is any form of memory pressure, the oldest cache info is thrown out. So, reading lots of data is a good way to invalidate caches. Which is why there are ways to hint the kernel that the data read will not be reused.

He continued:

Now, if you look at a HD performance sheet you see pretty impressive performance figures, maybe a disk can read 10MB/s, which surely sounds a lot more than what some itty bitty svn info is. I mean, if your svn status took 1s does that mean it had to read 10 meg of data? The problem is that the read rates is when you read consecutive data from the disk.

Think of the HD like an old record player, once you’re in the right place with the needle you can keep reading stuff fast as it rotates. However, once you need to move to a different place, called “seeking” you’re doing something very different. You need to physically move the arm, then wait for the platter to spin until the right place is under the needle. This kind of physical motion is inherently slow so seek times for disks are pretty long.

So, when do we seek? It depends on the filesystem layout of course. Filesystems try to store files consecutively as to increase read performance, and they generally also try to store inodes for a single directory near each other but it all depends on things like when the files are written, filesystem fragmentation, etc. So, in the worst case, each stat of a file will cause a seek and then each open of the file will cause a second seek. So, thats why things take such a long time when nothing is cached.

Some filesystems are better than others, defragmentation might help. You can do some things in apps. For instance, GIO sorts the received inodes from readdir() before stating them hoping that the inode number has some sort of relation to disk order (it generally has) thus minimizing random seeks back and forth.

One important thing is to design your data storage and apps to minimize seeking. For instance, this is why Nautilus reading /usr/bin is slow, because the files in there generally have no extension we need to do magic sniffing for each. So, we need to open each file => one seek per file => slooooow. Another example is apps that store information in lots of small files, like gconf used to do, also a bad idea. Anyway, in practice I don’t think there is much you can do except try to hide the latencies.

I also asked Alex why Thunar was so fast at loading the same directories, however a few moments later it occurred to me that the reason I thought Thunar was fast might have been because I was opening /usr/bin in it after I had already previously opened it in Nautilus, therefor the seeking and caching Alex talked about had already occurred. Alex responded with a resonant “aha!”. This may well be the reason why so many people say Nautilus is slow compared to X, they’re probably doing the same thing.

He then explained to me how to clear the cache, it turns out all you have to do is execute the following command as root:

sync; echo 3 > /proc/sys/vm/drop_caches

After doing so you’ll see that Thunar will also take quite a while to load up a directory such as /usr/bin, because of the same reason Nautilus does. Another interesting tidbit Alex pointed out was timing gvfs-ls directly. He told me to try out the following commands and stated “you’ll be surprised”.

sync; echo 3 > /proc/sys/vm/drop_caches
time gvfs-ls -a "standard::content-type" /usr/bin/ > /dev/null
sync; echo 3 > /proc/sys/vm/drop_caches
time gvfs-ls  /usr/bin/ > /dev/null

Note that the first gvfs-ls command took 16 seconds and the latter took 1.5 seconds. He explained that the only difference is that the first one reads the first 2k of each file. With the answer he provided earlier it should be quite obvious why there’s such a difference between the two commands.

Alex ended with the following note:

The real fix for this whole dilemma is to move away from rotating media. I hear the intel SSDs are teh shit. Linus swears by them.

I hope you all found this information as interesting as I did.

VN:F [1.9.7_1111]
Rating: 5.0/5 (7 votes cast)

Minor update released for beta

Posted in Miscellaneous on March 16th, 2009 by Bruce van der Kooij – Be the first to comment

There were some packaging problems I felt warranted an update/rebuild. Here’s what got fixed:

  • Updated version dependencies in control file so the package can be installed under Ubuntu 8.04. See Issue #100.
  • Make sure that gtk-update-icon-cache is executed after install. See Issue #87.
  • Have to prepend emblem- to all emblem files for them to be picked up by Nautilus <= 2.22.3. See Issue #87.

Looks like we still have to work out our version numbering scheme. :-)

Next, performance issues! \o/

That’s all folks.

VN:F [1.9.7_1111]
Rating: 0.0/5 (0 votes cast)

Change in strategy

Posted in Miscellaneous on March 11th, 2009 by Bruce van der Kooij – 3 Comments

Adam and I have come to the conclusion that the new status monitor that is needed to keep emblems up-to-date can not be included in the upcoming release, it’s simply not yet ready for production usage (among other things see Issues 4, 8, 89 and 90).

As we don’t see how we can significantly improve things with a few tweaks here or there we’ve decided to instead work on removing the status monitor completely for the time being and only have a status checker (similar to the situation in v0.11, but more elegant). We’ll also get the rest of the code up to production quality.

Regretfully, without the new status monitor we are not able to detect changes to files that are not directly visible in the Nautilus window. So if you’re in the directory /foo but the file /foo/bar/baz (baz) is added the emblems for foo and bar will not change to modified (assuming the status before was normal). This also means you cannot use the command-line svn client and expect emblems to be kept up-to-date.

UPDATE: actually after implementing the new status checker it turns out the above isn’t entirely correct. If you do alll VCS actions through NautilusSvn and don’t use the command-line all emblems will remain up-to-date. There seem to be two situations where we can’t keep emblems up-to-date:

  • If you’re in /foo and /foo/bar/baz is modified the status for /foo and /foo/bar will be incorrect. Nautilus doesn’t inform us about these modifications (which makes sense for normal extensions). The new status monitor is required to be able to do this.
  • If you’re in /foo and /foo/bar is “normal” and you add /foo/bar/baz by selecting NautilusSvn -> Add from the context menu of /foo. We’re only rechecking the paths you originally selected and any item you saw that was either “added”,  “deleted”, “replaced”, “modified”, “missing”, “unversioned”, or “incomplete”. There might be something I can think up here that might not impact performance all too badly.

Hopefully we will be able to get the status monitor ready for v0.13.

VN:F [1.9.7_1111]
Rating: 3.0/5 (1 vote cast)

What’s taking so long? Part I

Posted in Miscellaneous on March 10th, 2009 by Bruce van der Kooij – 3 Comments

In the words of Jace Hall (when sitting across the table from George Broussard and Scott Miller of 3D Realms, developers of Duke Nukem Forever):

On behalf of all of the fans out there, who know and love you guys. I say this with the most love that anyone could possibly [ask the question]: what the fuck is taking so long?

Let me take a shot at answering that question, let’s begin with the background. Starting with this chart from Ohloh, which should give you a rough idea of the activity of this project (note that the Google Code project, which Ohloh analyzes, was only started recently, in June of 2008, while NautilusSvn was originally started somewhere late 2006).

The last actual release was made by Jason in  July of 2008 and sported only a few minor changes, after that development pretty much died down.  The pace started to pick up once again when Adam joined the project mid November. This eventually led to my decision that Christmas (the time of the year people normally celebrate with their family) was the ideal time to start hacking away on NautilusSvn. During that period a lot of changes to NautilusSvn were made, more so than probably over entire 2008.

First of all, the entire codebase was heavily refactored. This is not something we took lightly. Every step of the way has been extensively documented on the wiki, from the decisions regarding the directory layout and the coding style to the architecture and the actual implementation. One aspect we’ve paid a lot of attention to was to clearly separate autonomous components. With an eye to the future we’ve started abstracting away from the actual VCS implementation. By doing this we increase the re-usability of major components of the system, so that in the future it will be trivially easy to support a different VCS whether that be Bazaar, Monotone, Git or any other VCS. We’re not there yet, but we believe we’re well underway. We’ve made sure that this goal would not interfere with our support of Subversion.

Somewhat of a sore eye in the previous version (for those of you who remember the dreaded “Refresh status” button) the core functionality, status checking and emblem handling, has been significantly improved. We’ve worked around some of the Nautilus extension API limitations and now NautilusSvn will also keep directory emblems up-to-date. This was somewhat of a pet issue of mine and I’m happy to see my efforts have not gon to waste. It’s still not quite there yet in terms of robustness, but overall it’s pretty decent and should work properly in most cases.

Another major change was that we’ve switched from using wxWidgets to GTK+ as our widget toolkit. This also means we’ve switched from using XRC files to Glade XML to describe the user interface, combined with the excellent Glade Interface Designer this should make modifying the GUI much more comfortable. As loyal users lurking on these mailing lists know this change was set in motion by the latest addition to our team, Adam Plumb. I personally think he’s done a fantastic job with refactoring the GUI layer.

This should give you some idea of what’s been happening over the last few months. In Part II I’m actually going to answer the question posed above.

VN:F [1.9.7_1111]
Rating: 0.0/5 (0 votes cast)

First beta real soon now(TM)

Posted in Miscellaneous on March 9th, 2009 by Adam Plumb – 2 Comments

For the past week, we’ve been working on releasing an actual beta package for NautilusSvn.  Alas, there are still some glitches and bugs we’re trying to work out, which is slowing down the release.  Hopefully we will have these worked out soon and we can charge forth into the next stage of development.  Stay tuned!

VN:F [1.9.7_1111]
Rating: 0.0/5 (0 votes cast)

Translating the v0.12 branch

Posted in Miscellaneous on February 25th, 2009 by Adam Plumb – 5 Comments

After initially writing off localization capabilities for v0.12, preferring to wait until v0.13 for that, I later changed my mind and spent some time figuring out how to do it, implementing it, and writing up the documentation for others.

Translating NautilusSvn is a fairly simple process.  We provide a template file that has the English text from our program and a space for the translated text that you will write.  The template file is located at branches/v0.12/nautilussvn/po/NautilusSvn.pot in our svn repository.  In order to start your own translation, you will first need to install the gettext and intltool utilities, which you can generally get from your linux distribution.  You may also want to install poedit, which is a popular and very useful GUI translation tool.

Once you’ve got your environment set up correctly, you can generate the actual translation file you’ll be using.  First, figure out which language and locale you’ll be translating NautilusSvn to.  For example,  en_US is English/United States (the default), and en_CA is English/Canada.  For a list of locale codes, go here.  And for a list of country codes, go here.

Once you’ve figured out your language and locale, you can begin.  For the purposes of this tutorial, I will set up a translation for en_CA (Canadian English).

$ cd /path/to/nautilussvn
$ msginit –input=po/NautilusSvn.pot –locale=en_CA
$ mv en_CA.po po/en_CA.po

The translation file you want to modifiy is now in the po folder, and you can begin your translation!  You may use poedit or another GUI tool or edit the text file by hand.  Once you’ve finished, type:

$ mkdir -p locale/en_CA/LC_MESSAGES
$ msgfmt –output-file=locale/en_CA/LC_MESSAGES/NautilusSvn.mo po/en_CA.po

And you’re done!  If you want NautilusSvn to use your changes, you’ll want to export your language (en_CA) to the LANGUAGE environment variable and restart nautilus and NautilusSvn:

$ export LANGUAGE=en_CA
$ nautilus -q; pgrep -f service.py | xargs kill; nautilus no-desktop; pgrep -f service.py | xargs kill

When your translation is all finished, open a new issue in our Issue Tracker and attach the NautilusSvn.mo and .po files that you created.  We will immediately update our development trunk, and it will be included in the next official release.

Launchpad Translations

We’re currently trying to get our project set up on Launchpad in order to coordinate translations from there, but it isn’t quite set up yet.  We will make an announcement on this development blog and also our mailing list when it is completely set up.

String Freeze

NautilusSvn is currently in the “ALPHA” stage of release and we have not yet reached “string freeze” (the point at which we will not change the English strings in the program).  Strings won’t be frozen until we reach the “BETA” release, which is scheduled to happen next week (but it may not if there is a delay).  You can start translating now if you’d like, but please be aware of any changes that happen to the NautilusSvn.pot template file until the beta.

Happy Translating!

VN:F [1.9.7_1111]
Rating: 1.0/5 (1 vote cast)