-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 so the scala actors add much more overhead than the clojure equivalent?
Am 07.09.2011 07:32, schrieb Sean Corfield: > I just wanted to share this experience from World Singles... > > Back in November 2009, we started developing with Scala. We needed > a long-running process that published large volumes of changes from > our member database as XML packets published to a custom search > engine. The mapping from half a dozen tables in the database to a > flat XML schema was pretty complex and the company had tried a > number of solutions with mixed success in the past. I introduced > Scala based on the promises of performance, concurrency and type > safety - and conciseness (especially with XML being a native data > type in Scala). > > We've been running the Scala publishing daemons in production for > most of two years. Generally they work pretty well but, under > stress, they tend to hit Out of Memory exceptions and, after a lot > of poking around, we became fairly convinced it was due (at least > in part) to the default actor implementation in Scala. Scala is > going to fold in Akka soon and we had been considering migrating to > Akka anyone... > > But having introduced Clojure this year (after experimenting with > it since about May last year), we figured we'd have a short spike > to create a Clojure version of the Scala code to see how it worked > out. > > It took about 15 hours to recreate the publishing daemon in > Clojure and get it to pass all our tests. Today we ran a "soak > test" publishing nearly 300,000 profiles in one run. The Scala code > would fail with OoM exceptions if we hit it with 50,000 profiles in > one run (sometimes less). The Clojure code sailed thru and is still > happily running - so we'll be replacing the Scala code during our > next production build. > > The other aspect that's interesting is that the Scala code totaled > about 1,000 lines (about 31k characters of code). The Clojure > replacement is just under 260 lines (around 11.5k characters of > code). Neither code base has much in the way of comments (*ahem* - > I'm not proud of that, just pointing out that there's no "noise" > offsetting the code comparison). That doesn't include unit tests > either, it's just the raw production code. The form of the Clojure > code mostly follows the form of the Scala code, most of the same > functions - it was very functional Scala - with some refactoring to > helper functions to make it more modular and more maintainable. > > The net result is (obviously) that we'll be taking the Clojure > publishing daemon to production and we'll be dropping Scala > completely. > > Kudos to Rich Hickey and the Clojure/core team for creating a > great general purpose language that can solve big problems - thank > you! - -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJOZ6cgAAoJENRtux+h35aGsxoQAKAkmQb/8cxVsHSw1bH6mZjW Hoea0zi90eO2ds9Wk1wrFjtc0wfPPHdrp0FpZ3w1090BkwyKcRBj/iDM45sP4IY5 grc2I6vaRhfgIIVuaxgUt9HzTCbyjCOxk9xJHpCyY7sIfEIcFwNuzQWVHxgdqG/l CY/9mDe1Wex3rt2QxCSsUX/+yB5uXaxmAoX5m0jyEAmZzw/46+cVzZ8xMi9Gw1o/ mjI/mvpwTmdGcPkh7DamIEU8QjYbNBosgPWpNktJzmhtUaFdXhEMxdyDhldzUcJZ J8tZZkTWZoQqPfVdMPgfe1blDtV+nse8X2HDqed+Df42TU1YY+1VJ7e8jfr3vV62 cI+6SAqYTT91UC57GkmYKVOm01vNMpp98+fxaxBHUQi64tv/hIkWG4iHRgBCvncR hdIKfmzVwcPGrOZu6QT0RrVQzeEbz83+3l4CZQ7KOdL8k5vjd5b1T/LsPrQM1rod jDAn481tmpZKtSLe8+QbSakxfIFT9oTKUXbtDEEkN2CbJOkE4/EQwuCc/gnlo9Mr YPlPfx96JLxBfVq6JZ92VSdrpnEBS65HjKhWF587XjGjTqzYbbCNJIekwRdqga8e zkonzIj+IgnuZznV/fbKZ2yCEnO85TXoj0ZWUDnw0Ffvu2vUFvSF0ykR2BHxZBFD a1yhe/wr8AGyvIff6Hj8 =N1zz -----END PGP SIGNATURE----- -- 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