4 ms·
How to make Lisp go faster than C [pdf]
- martincmartin 16y agogcc 4.0.3 vs. CMUCL, the predecessor to SBCL.
- Avshalom 16y agoTo those who know the SBCL compiler better: The paper says that to get the speed they had to turn off run time type checking, but they say "here's how to do it globally" does that mean you can turn of type checking in just one module or function?
- martincmartin 16y agoYes. The Common Lisp spec says you can put declarations a lot of places, including prog: http://clhs.lisp.se/Body/s_declar.htm http://clhs.lisp.se/Body/s_declar.htm So you can basically wrap it around any S-expression you want. When I was at ITA we did that a lot. For example, there was a macro i+ that would expand to basically "the two arguments are fixnums, as is the result. Now, please give me the sum." In debug builds, the type declarations would be come assertions. In release builds, they'd become assumptions, i.e. the whole thing would compile to a single x64 ADD instruction.
- deleted 16y ago[deleted]
- lispm 16y agoCommon Lisp allows you to wrap declarations around forms. Use LOCALLY for that.
- VMG 16y agobarely readable
- jgg 16y agoWhat do you mean? Is it the layout, the content or something else? I was able to read it just fine.
- j_baker 16y agoThe scribd version is pretty bad.
- jgg 16y agoAh, you're right, that is bad. I had only looked at the raw PDF.
- twobar 16y agoThe scribd version is nearly unreadable, but the pdf is fine.
- VMG 16y agothe scribd version and Gnomes epdfviewer had terrible resolution, so I assumed it was a scanned document. Evince displays it correctly. The scribd version seems to be terrible for everybody though
- greglindahl 16y agoThis is typical for papers like this: take a toy algorithm, show it's kinda as fast as C/Fortran if you do something really odd, then declare victory. This works better if your C compiler lacks important optimizations, like a loop nest optimizer. If you really want to impress people, take a significant algorithm, preferably one of the SPECcpu benchmarks, write the whole thing in Lisp, and then see what happens.
- nearestneighbor 16y agoIt's not just Lisp. Language advocates are the snake oil salesmen among computer scientists. Case in point: http://www.reddit.com/r/programming/comments/bnnoh/fast_automatically_parallel_arrays_for_haskell/c0npq4j http://www.reddit.com/r/programming/comments/bnnoh/fast_auto...
- jgg 16y ago>It's not just Lisp. Language advocates are the snake oil salesmen among computer scientists. It's true. (-: I submitted the paper mostly because it's a condensed "how-to" for optimizing Common Lisp code. I think the name of the paper itself is really, really sketchy.
- j_baker 16y agoI admit to not having read the paper all the way through, but Figure 2 only shows Common Lisp as being noticeably faster than C in one instance, and I suspect that's due to an anomaly of some kind (it's totally out of line with the other C speeds).
- swolchok 16y agoWhy is the scribd version 1) ugly and 2) in Flash? I thought they were all HTML 5 these days, and I'd clicked the scribd link to give them another chance.