Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minBidCacheTTL better memory optimization #11310

Open
andyblackwell opened this issue Apr 9, 2024 · 3 comments · May be fixed by #11776
Open

minBidCacheTTL better memory optimization #11310

andyblackwell opened this issue Apr 9, 2024 · 3 comments · May be fixed by #11776
Labels

Comments

@andyblackwell
Copy link
Contributor

andyblackwell commented Apr 9, 2024

Type of issue

feature request

Description

currently minBidCacheTTL is applied at the auction level, so if you get a single bid with a long TTL, like an hour, then all the bids in the auction stay around for the full hour

const _auctions = ttlCollection({
startTime: (au) => au.end.then(() => au.getAuctionEnd()),
ttl: (au) => minCacheTTL == null ? null : au.end.then(() => {
return Math.max(minCacheTTL, ...au.getBidsReceived().map(getTTL)) * 1000
}),
});

any reason we couldn't remove bids as they expire directly, in the auction object?

let _bidsReceived = [];

could leave the auction-level removal as well, as that also frees up memory from all the other stored info in an auction like: requests, nobids, non bids, winning bids, etc

Other information

#10308

@patmmccann
Copy link
Collaborator

@andyblackwell great Idea! Does aditude plan to submit the fix?

@patmmccann
Copy link
Collaborator

Talked about this, we think a behavior change would likely not break anyone and we likely do not need additional configuration for this behavior. It seems to be a welcomed change.

@fowler446
Copy link
Collaborator

@patmmccann How about this ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready for Dev
4 participants