johnsonjh / johnsonjh/duma

Performance lag?

Open
#228 0 comments 0 reactions 1 assignee Claimed by @johnsonjh View on GitHub
enhancement
Dominant language
C
Stars
121
Forks
12
Avg merge
3h 13m
Merged PRs (30d)
1

Description

Hi,

(for the linux environment)

In the function _duma_allocate(), during the loop where we try to find the free slot, even after finding the free slot and 2 empty slots, we run through all the slot structures. If I am correct, by design, the empty slots come after the free slot, so after we find the 2 empty slots, shouldn't we break the loop?

```
} else
#endif
if (DUMAST_EMPTY == slot->state) {
if (!emptySlots[0])
emptySlots[0] = slot;
else if (!emptySlots[1])
emptySlots[1] = slot;
**else
break;**

```
For example,
test program tstheap with a test duration of 10000 runs for 160 seconds without breaking the for loop, and runs 120 seconds with breaking the loop.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.