Better HN
topnewbestaskshowjobs
Log inSign up

anon1608

2 karma · joined Aug 10, 2021 (5y ago) · 1 submissions

Submissions

comment 5y ago · link · parent

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?