3 ms·
I wonder how much of the speed change came from the difference in languages versus the difference in experience when writing both. The ruby version was written
by zackzackzack 14y ago
I wonder how much of the speed change came from the difference in languages versus the difference in experience when writing both. The ruby version was written prior to the clojure one and so anything that was learned about git/programming during the ruby writing would haven be available during the clojure writing. I can believe that clojure would be faster; using concurrency well guarantees this somewhat. I still wonder what would have happened if they had written the clojure version first without having written the ruby version. Or wrote a ruby version after the clojure version.
- dsabanin 14y agoWell, once I was done with writing code to cache a Subversion repo, it was clearly visible how much faster Clojure is. Basically same loop to go through all revisions in a repo was 15-20x times faster in Clojure than in Ruby. Very similar calls, pretty much same algorithm. But something that Ruby does inside the bindings was not very efficient. For Git the problem was a bit different. Internally Grit (the Git API library for Ruby) tries to read huge pack files (potentially hundreds of MBs) in pure Ruby. This just can't be fast. There's also additional overhead of not using any ORM for operating with our caches in Clojure version. That probably contributed to overall performance improvement, but 20x for svn / 40x for git measurement was taken even before we got to saving the results into DB and it stayed that way later on.
- asparagui 14y agoAccording the article, they were using ruby to bridge to a svn module that had git capability. They replaced that module with a native git library, called from Clojure. In summary: benchmark, profile, find hotspots, optimize. Works in every language. >:3
- dsabanin 14y agoSorry if it sounded confusing, but we had two modules: one for svn, one for git, there was no intersection between those. But I agree, we've used Clojure(and JVM) in exact point where it would bring the most speed up to our app.