this post was submitted on 03 Dec 2024
5 points (100.0% liked)

Clojure programming language discussion

458 readers
2 users here now

Clojure is a Lisp that targets JVM and JS runtimes

Finding information about Clojure

API Reference

Clojure Guides

Practice Problems

Interactive Problems

Clojure Videos

The Clojure Community

Clojure Books

Tools & Libraries

Clojure Editors

Web Platforms

founded 4 years ago
MODERATORS
 

C and C++ are really so fast?

https://dev.to/taqmuraz/c-and-c-are-really-so-fast-5gf1

During all that time I am engaged with programming, I hear that C and C++ are the speed standards. Fastest of the fastest, compiled straight to assembly code, nothing may compete in speed with C or C++. And, nobody seem to challenge that common...

#clojure #clj #cljs [email protected] @clojure

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 4 points 2 weeks ago

I can't speak to it, but perhaps Andrew Koenig and Barbara Moo, who have written the Accelerated C++ textbook can:

We can be confident about the program's performance because the C++ standard imposes performance requirements on the library's implementation. Not only must the library meet the specifications for behavior, but it must also achieve well-specified performance goals. Every standard-conforming C++ implementation must

  • Implement vector so that appending a large number of elements to a vector is no worse than proportional to the number of elements
  • Implement sort to be no slower than nlog(n), where n is the number of elements being sorted

The whole program is therefore guaranteed to run in nlog(n) time or better on any standard-conforming implementation. In fact, the standard library was designed with a ruthless attention to performance. C++ is designed for use in performance-critical applications, and the emphasis on speed pervades the library as well.