Hacker News new | past | comments | ask | show | jobs | submit login

As always with microbenchmarks...

  struct Error* create_error(const char *msg) {
    struct Error *e = malloc(sizeof(struct Error));
    e->msg = strdup(msg);
    return e;
  }

Is it measuring exceptions vs return codes, or creation cost of std::runtime_error(const char *) (small string opt?) vs malloc() + strdup?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: