3 ms·
This really isn't worth discussing since nobody seriously considers LISP an easily optimizable language. Did you know a minor change to improve cache-hits on a
by soup10 12y ago
This really isn't worth discussing since nobody seriously considers LISP an easily optimizable language. Did you know a minor change to improve cache-hits on an inner loop can double the speed of an algorithm? That's just the tip of the iceberg. You need to be close to the metal to optimize and LISP does not provide for that. It's only fast relative to dog slow languages that were programmed on far newer hardware and could get away with it.
- sjolsen 12y agoHave you ever personally tried to optimize a Lisp program? It isn't terribly difficult, as optimizing goes. You have full access to control flow as far down as goto, and you can use machine integers and arrays. Depending on the implementation, you may even be able to use explicit pointers. Obviously it isn't any closer to modern hardware than C, but as far from the hardware as the high-level parts are, the low-level parts are pretty reasonably close.
- lispm 12y agoTypically, optimized Lisp code is around 50% slower than C. This is only available on mainstream processors. Specialized and very fast hardware usually lacks Lisp implementations - with a few exceptions. Which puts it into similar regions as Java, Go or D. Unoptimized Lisp code can be a lot slower, but it then supports a bunch of interesting dynamic behavior. The main approach of better performing Lisp systems is to provide a wide variety of programming styles and a lot of flexibility, while being at the same time fast enough, so that not much software needs to be written in C or assembler. For example in a large CAD system it is possible to write much of the code in Lisp - in a space where such an application has to compete with systems written in C and especially C++. Depending on the quality of the Lisp implementation, the C/C++ part gets larger or smaller. For example one of PTC's Creo CAD systems is written mostly in Lisp - a bit more than 6 million lines of Lisp code was reported a few years back.
- lokedhs 12y agoNobody? I'm sure you researched that statement along with spending some time actually doing that before you said it right? In most versions of Common Lisp you can see the exactly assembler output of your function, allowing you to optimise your code at any level you want. Like other people mentioned, you can add type declarations to ensure that the correct machine types are used, and you even have goto. What specific aspects of Lisp are you saying prevents optimisation? Especially given that Lisp has more low-level control than most other languages.