TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

SBCL quicker than C?

69 点作者 lbolla超过 14 年前

7 条评论

rst超过 14 年前
SBCL = Steel Bank Common Lisp<p>More precisely, if you tell the SBCL compiler to trust that all data types are as declared and omit type checks, it gives you code that's faster than gcc with the options at the bottom of this page: <a href="http://shootout.alioth.debian.org/u32/benchmark.php?test=spectralnorm&#38;lang=gcc#log" rel="nofollow">http://shootout.alioth.debian.org/u32/benchmark.php?test=spe...</a><p>These are "inner loop only" compiler settings, at least the way I'd use it --- but it's still nice to see concrete demonstrations that you don't <i>have</i> to drop down to C code to get maximum performance.<p>EDIT: (declaim (safety 0)) also omits array bounds checks, and checks for undefined variables.
评论 #2193470 未加载
stevejohnson超过 14 年前
I just started reading the thread linked from the blog post, and it felt like reading House of Leaves. Here are some choice quotes from various authors:<p>Re Clojure: "This is a 'babel' plot to destroy lisp."<p>"Pocket Forth is a free Forth interactive-interpretor that runs fine on my Macintosh "Performa 600" (68030-CPU) System 7.5.5."<p>"The Mac is a desktop-publishing 'appliance' --- considering that you don't have a laser-printer, a Mac is about as useful to you as a bicycle is to a fish. Besides that, you don't seem like the desktop-publishing type of guy --- that is mostly a marketing-department girl thing."<p>"I really foresee the collapse of civilization. The majority of people in America are motivated entirely by hate, fear, greed and envy, and this situation can't continue indefinitely. This is what I describe in my book, 'After the Obamacalypse,' which is included in the slide-rule package on my web-page."<p><pre><code> Another time I was sitting in my van in a parking lot. A skinny Jew walked up to the van, peered inside, then tried to open the door but discovered that it was locked, so he walked away. I got out and walked over to him, and I said: "What the hell do you think you're doing?" He also said that he thought it was his friend's van, but he didn't apologize at all, but became prideful and belligerent. When I said, "I think you're a thief," he said: "Look at the way you're dressed; you're the thief!" (I was wearing a hoodie). He told me that if I continued bothering him, he was going to call the police, and he got out his cell-phone. When I said, "I think you were looking for something to steal," he said: "There is nothing in your van worth stealing!" I beat him thoroughly with my fists and left him face down on the sidewalk in his own blood. Somewhat belatedly, be began to cry: "I'm sorry! I'm sorry!" </code></pre> It ends shortly after "Discussion subject changed to 'Whining (was Re: ordered associative arrays)' by John Passaniti."
评论 #2193512 未加载
评论 #2193136 未加载
rlpb超过 14 年前
He specifically asked gcc for optimisation for code size (-Os). For speed, he should be using -O3 only. He used "-Os -O3". This invalidates the benchmark.
评论 #2192768 未加载
评论 #2192943 未加载
评论 #2193716 未加载
McP超过 14 年前
For N &#62;= 3000 C is significantly faster. My guess is the initial slowness is caused by OMP initialising.
slavak超过 14 年前
Is this really still news? Yes, we know you can get great performance in some tasks with languages other than C. I swear, if I see ANOTHER article with the linkbait title of "X faster than C"...<p>The decent ones posted at least bother to do a comparison with several pseudo-representative tasks. This one just goes "hey, I played around with this ONE SPECIFIC TASK NOBODY GIVES A CRAP ABOUT and IT RAN 0.006 MILLISECONDS FASTER THAN IN C! WOOOOOOOOOOOO!"
评论 #2192742 未加载
评论 #2192753 未加载
jsnell超过 14 年前
At least in the past the Shootout code wouldn't have explicit (declaim (optimize ...)) in the source files, but the command used to compile the files would have it. Did it really get removed from the command line?
评论 #2193374 未加载
unklem超过 14 年前
This question is incorrect, C is a language, SBCL is a CL compiler. Kindly amend that.
评论 #2196929 未加载