if (!size)
return 0;
if (!ctx->last_pass_time)
- return -1;
+ return 0;
return (uns)((double)size / (1<<20) * 1000 / ctx->last_pass_time);
}
static sh_off_t
sbuck_ins_or_join(struct sort_bucket *b, cnode *list_pos, struct sort_bucket *join, sh_off_t join_size)
{
- if (join)
+ if (join && join->runs >= 2)
{
if (b)
sbuck_drop(b);
SORT_XTRACE(2, "Final timings: %.3fs external sorting, %.3fs presorting, %.3fs internal sorting",
ctx->total_ext_time/1000., ctx->total_pre_time/1000., ctx->total_int_time/1000.);
ctx->out_fb = sbuck_read(bout);
+ mp_delete(ctx->pool);
}