4 ms·
> started writing Postgres in LISP. Had to revert that decision as everything was an order of magnitude slower If they have never written a high-performance ap
by lispm 9y ago
> started writing Postgres in LISP. Had to revert that decision as everything was an order of magnitude slower
If they have never written a high-performance application in Lisp, they would have needed a bit more work. The Lisp version was written more as an experiment:
http://db.cs.berkeley.edu/papers/ERL-M90-34.pdf http://db.cs.berkeley.edu/papers/ERL-M90-34.pdf
> Our feeling is that the use of LISP has been a terrible mistake for several reasons. First, current LISP environments are very large. To run a ‘‘nothing’’ program in LISP requires about 3 mbytes of address space. Hence, POSTGRES exceeds 4 mbytes in size, all but 1 mbyte is the LISP compiler, editor and assorted other non required (or even desired) functions. Hence, we suffer from a gigantic footprint. Second, a DBMS never wants to stop when garbage collection happens. Any response time sensitive pro- gram must therefore allocate and deallocate space manually, so that garbage collection never happens dur- ing normal processing. Consequently, we spent extra effort ensuring that LISP garbage collection is not used by POSTGRES. Hence, this aspect of LISP, which improves programmer productivity, was not avail- able to us. Third, LISP execution is slow. As noted in the performance figures in the next section our LISP code is more than twice as slow as the comparable C code. Of course, it is possible that we are not skilled LISP programmers or do not know how to optimize the language; hence our experience should be suitably discounted.
They had problems because Lisp alone needed 3 Megabytes of address space (!) to run - a 'gigantic footprint' - , needed to work around the GC and their C version was twice as fast.
Their main problem was that they wanted to write it in a mix of C with Lisp and it was hard to debug for them. I'm not surprised that people with no experience writing applications in a mix of C + Lisp failed to write a database engine. I'm pretty sure it is easier to write a database engine in C compared to a mix of C and Lisp, without GC and crossing the boundaries of a managed runtime and plain C data. People did that, but these people had quite a bit more experience writing such applications.
You can buy for example AllegroGraph, a graph database in Allegro Common Lisp:
https://allegrograph.com https://allegrograph.com
You can bet that the NSA/CIA/Homeland Security etc. all have it running with very large datasets about you, me and all the others.
- mpweiher 9y agoFrom the section you quoted: "As noted in the performance figures in the next section our LISP code is more than twice as slow as the comparable C code." I don't doubt that you can write productive systems in CL (bit of a fan myself), but the "oh we have smart compilers that just make it as fast as C" just isn't true.
- lispm 9y ago> I don't doubt that you can write productive systems in CL (bit of a fan myself), but the "oh we have smart compilers that just make it as fast as C" just isn't true. But 50% of C is great. Imagine in Lisp you can achieve 50% performance of C. That means you can write large amounts of your code in Lisp, without the need to use C. Actually it is both better and worse. One can achieve better than 50% and in many cases one is slower than 50% of C. For example you can optimize your code at runtime using the Lisp compiler. But in many cases you will be slower, since C compilers and libraries tend to have better support for hardware. For many many applications 50% performance of C is completely sufficient. Zillions of lines of code are written in much slower environments...
- ealhad 9y agoIt must not be forgotten that performance isn't always the main concern, let alone the only one. And yeah, the expressiveness/speed ratio of Lisp is great.
- FrozenVoid 9y agoI don't deny it, just that that expressiveness has a cost and Lisp advocates assume that cost is negligible, while in reality it is important(Lisp Machines were created just so that Lisp would run at acceptable speed)
- lispm 9y agoLisp Machines were developed as a new breed of computers: personal workstations for AI researchers. Starting in the 80s a lot of people/companies made Lisp run with 'acceptable speed' on more conventional Personal Computers, once these got available.
- ealhad 9y agoThe thing is, back in the 80s (before I was even born!), the cost was huge, but it has stayed the same until now. So, yeah, it cannot best good C/C++, or even optimized Java, but it still outperforms any scripting language. You know what they say, the right tool for the right job.