News for hackers. Stuff that matters.
Re:Disqus bait and switch, now with ads by sehe on Tuesday February 19, 2013 @07:33PM (#5248178)
I can't say I'm impressed here.

In the process of being all self righteous and morally outraged, you have killed the comments contributed by your audience.

It strikes me as odd that I kept coming back to your blog, mainly to see whether my comment #775739854 of ~January 23rd was still pending moderation. That post represented considerable effort and it included remarkable data points highly relevant to your post subject.

I noticed I wasn't really the first person to actively bump his comments in order to get noticed. Also, this was the second time I posted said comment at that very article. Somehow, the first one got mysteriously missing, after having been pending for moderation. So all of this leaves me wondering whether you were just not ready to maintain your blog, including comments.

Here is the gist of the comment (I can't reproduce the version anymore, since you ... destroyed it):

> http://jacquesmattheij.com/when-haskell-is-not-faster-than-c...

===================

Hmm. I might be missing something.

But I too read that article you linked, and decided to whip up something in C++. Here's what I wrote, largely unoptimized: https://gist.github.com/4590998#file-cpp-version-cpp

To my surprise, it was ~40x faster than your C version... (tested with the original test input replicated 2500 times). Here's the timings (makefile included in the gist I linked)

sehe@desktop:/tmp/4590998$ time ./cpp-version < input | md5sum 33ad35318cfcdc0b675f33633b26445b - real 0m2.187s

sehe@desktop:/tmp/4590998$ time ./c-version < input | md5sum 33ad35318cfcdc0b675f33633b26445b - real 1m30.358s

(the md5sum is just there to verify that the results are identical)

===================

Re:Disqus bait and switch, now with ads by sehe on Tuesday February 19, 2013 @09:08PM (#5248535)
O hey, just found the heap profiling runs.

As you can see, the C++ version uses much less memory (also the C version by the OP uses 73MB - whoa; The OCaml#3 might report 12MB, but the C++ version clocks in at just 12KB. I'm guessing he C++ version would use the same order of magnitude as the OCaml#3 on comparable input sets, though)

    Command:            ./c-version
    Massif arguments:   (none)
    ms_print arguments: massif.out.18434
    
        MB
    73.22^#                                                                       
         |#                                                                       
         |#                                                                       
         |#                                                                       
         |#                                                                       
         |#                                                           :           
         |#                                                           :           
         |#:::::::::::::                                              :           
         |#: :::::::::::::@::::@::::::@::                             :           
         |#: :::::::::::::@::::@::::::@:::@::::@:::@::::              :           
         |#: :::::::::::::@::::@::::::@:::@::: @:::@::::::::::@::::   :           
         |#: :::::::::::::@::::@::::::@:::@::: @:::@::::::::::@::::::@::::::      
         |#: :::::::::::::@::::@::::::@:::@::: @:::@::::::::::@::::::@::::::@:::: 
       0 +----------------------------------------------------------------------->Gi
         0                                                                   16.24
    
    --------------------------------------------------------------------------------
    Command:            ./cpp-version
    Massif arguments:   (none)
    ms_print arguments: massif.out.18391
    --------------------------------------------------------------------------------
    
        KB
    12.15^@                                                                       
         |#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
         |#                                                                      :
       0 +----------------------------------------------------------------------->Gi
         0                                                                   11.17
Re:Disqus bait and switch, now with ads by sehe on Tuesday February 26, 2013 @08:11PM (#5289819)
Ah well. It looks like I'm just invisible to you then. Sorry for bothering.

Good luck with the blog