

Impressed By Slow Code - angusgr
http://prog21.dadgum.com/98.html

======
antirez
A much better C standard library would help a lot into thinking at C code from
an higher level point of view. Especially if you have easy to use data
structures in form of a lib, it is really easy to resist to use a list and
O(N) lookups just to type less code where an hash table is a better feet.

Why the C standard library does not get improved with a few data types like
linked lists, hash tables, dynamic strings, and so forth is something I can't
understand (one common reason why poorly written C code ends slower than
equivalent code wrote in a scripting language is because of strlen() and other
stupid string operations into a loop ending into exponential time complexity).

~~~
pavlov
There have been attempts to provide a better standard library in plain C, and
in fact these are fairly well available in operating systems. The problem is
that no library spans all platforms.

On Unix systems with Gnome, there's GLib. It's very well-featured, very
portable and available as prebuilt DLLs for Windows, at least.

On Mac OS X and iOS, there's CoreFoundation. My humble opinion is that it's
the best OO-style C library. I'd love to use it on Windows, but unfortunately
Apple wavered on their original commitment of open-sourcing CoreFoundation.
They stopped releasing the source, and getting CF to build became very
complicated at some point. I've lost track of what's the current situation,
but clearly this makes it very difficult to rely on CF for cross-platform
applications.

------
merraksh
<http://news.ycombinator.com/item?id=2504672>

------
forgottenpaswrd
"I've seen Python programs that ended up faster than C".

Yeah, there is nothing in c that makes it significant faster per se than
python, remember python is pre-compiled.

C gives you control, it is "portable assembler" if you are used to assembler
it is trivial to know exactly what the CPU does, if you can take advantage of
it it will be faster, if you can't it wont.

With control you can make something run 100-1000 times faster because you know
what the computer does, with a high level language you can not control it,
period, it is abstracted.

That is the use of C or specific hardware(100-1000 less power usage).

Low level optimizations for a 10% speed up?. IMHO, Non sense.

~~~
palish
A 10% time difference can make or break whether a video game truly feels real
time. That's 54fps => 60fps.

If you mean "You typically get far more than a 10% return on low-level
optimization investment," I agree. It's typically a dramatic improvement.

