Rewriting in C++ for Fun, Speed and Masochism

Discussion in 'C++' started by Lynn McGuire, Oct 11, 2012.

  1. Lynn McGuire

    Lynn McGuire Guest

    Lynn McGuire, Oct 11, 2012
    #1
    1. Advertising

  2. Lynn McGuire

    Jorgen Grahn Guest

    On Thu, 2012-10-11, Lynn McGuire wrote:
    > Rewriting in C++ for Fun, Speed and Masochism:
    > http://petersobot.com/blog/rewriting-in-cpp-for-fun-speed-and-masochism/
    >
    > Interesting little article on rewriting an app
    > in C++ from Ruby. Sped up 50X but the errors
    > in the library libjpeg were killing him.


    The real conclusion is this one further down, I think. He switched
    again from libjpeg to another library and then:

    When given the right amount of abstraction - in this case, a fast
    C++ library - writing the code to be adequately fast was trivial.
    Using old-school C-style library integration, on the other hand,
    ended with me wasting hours making little to no progress.

    Not that personally believe this is the core of the choice between
    Python/Ruby/etc and C++. I want the static typing, for better
    maintainability of larger programs.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
    Jorgen Grahn, Oct 11, 2012
    #2
    1. Advertising

  3. Jorgen Grahn <> wrote:
    > The real conclusion is this one further down, I think. He switched
    > again from libjpeg to another library and then:
    >
    > When given the right amount of abstraction - in this case, a fast
    > C++ library - writing the code to be adequately fast was trivial.
    > Using old-school C-style library integration, on the other hand,
    > ended with me wasting hours making little to no progress.


    libjpeg is one of the most horrendously designed libraries in existence
    (even by the typical standards of C libraries). The sad thing about it
    is that it's the "standard" library for jpeg support...

    It could have been made much, much better. As an example of a similar
    C library that's actually quite well designed, take libz. Especially
    if you are compressing to or decompressing from a file, its usage is
    laughably simple (basically, if you know how to use C I/O functions,
    you know how to use libz).

    (If you are (de)compressing from memory to memory it's a bit more involved,
    but not a lot.)

    In contrast, libjpeg is horrendous and really complicated to use.
    Juha Nieminen, Oct 12, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. efiedler
    Replies:
    1
    Views:
    2,015
    Tim Ward
    Oct 9, 2003
  2. Andy Fish
    Replies:
    65
    Views:
    1,695
    Mabden
    May 18, 2004
  3. dolphin
    Replies:
    4
    Views:
    312
    Jorgen Grahn
    Aug 25, 2007
  4. er
    Replies:
    2
    Views:
    485
  5. Weng Lei-QCH1840
    Replies:
    1
    Views:
    175
    Thomas
    Aug 15, 2003
Loading...

Share This Page