all 11 comments

sorted by: hot top controversial new old
[–] 21 points 10 months ago (1 child)

if /dev/null is fast and web-scale, i will use it!

  • source
  • hideshow 1 child comment
  • [–] 12 points 10 months ago (1 child)

    Hey Mongo, store this stuff; trust me it's 1 MB. In case it turns out it is not, just give me 1 MB worth of your data.

    Thank you very much.

  • source
  • hideshow 1 child comment
  • [–] 16 points 10 months ago (1 child)

    I want to thank this guy for dropping this in Christmas.

    Luckily my mongo ports are hidden from the Internet, as everyone else's should be, so it will survive until Monday when I can upgrade.

  • source
  • hideshow 1 child comment
  • [–] 2 points 10 months ago (3 children)

    TLDR use calloc instead of malloc

  • source
  • hideshow 3 child comments
  • [–] [S] 1 point 10 months ago (2 children)

    Doesn't that make it slower because it needs to zero out all the bytes first?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 10 months ago (1 child)

    My understanding is that it's only slightly slower: the OS maintains a pool of zeroed pages anyway, so it's not like your program has to iterate over all the addresses and write to them.

    But it's been a long time since I've done any C/C++ so I could be wrong.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 10 months ago