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

YieldMo optimization opportunity. #5098

Closed
DecayConstant opened this issue Apr 8, 2020 · 4 comments
Closed

YieldMo optimization opportunity. #5098

DecayConstant opened this issue Apr 8, 2020 · 4 comments
Labels

Comments

@DecayConstant
Copy link

DecayConstant commented Apr 8, 2020

I was investigating a Chrome performance profile, looking for bottlenecks in my own code, but I noticed this in a Prebid callBids call. YieldMo's own buildRequests is much slower than any other bid adapter. It's caused by the DOM manipulations that occur in the isSuperSandboxedIframe() function.

I don't know what that's for and if it's really necessary, but could you reorder the checks that happen in getEnvironment() so that the most common results are checked for first so you avoid the additional unnecessary checks for the less common environments? Or is the order of those checks important?

Caramel_Chicken_-_Vietnamese_Caramel_Chicken_-_Rasa_Malaysia

function getEnvironment() {
if (isSuperSandboxedIframe()) {
return 89;
} else if (isDfpInAmp()) {
return 5;
} else if (isDfp()) {
return 4;
} else if (isAmp()) {
return 1;
} else if (isDFPSafeFrame()) {
return 11;
} else if (isSafeFrame()) {
return 10;
} else if (isMraid()) {
return 2;
} else if (isCodeOnPage()) {
return 0;
} else if (isSandboxedIframe()) {
return 16;
} else {
return 90;
}
}

@snapwich
Copy link
Collaborator

snapwich commented Apr 8, 2020

@HolzAndrew ^

@mglowackiym
Copy link
Contributor

Thank you for surfacing this. We will review internally and evaluate possible solutions.

@HolzAndrew
Copy link
Contributor

@snapwich @DecayConstant I have alerted my team to this and we are adding it to our roadmap to address. Thank you!

@stale
Copy link

stale bot commented Apr 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 23, 2020
@stale stale bot closed this as completed Apr 30, 2020
arconamagi pushed a commit to yieldmo/Prebid.js that referenced this issue Jul 20, 2020
bmwcmw pushed a commit that referenced this issue Aug 10, 2020
…imize #5098, minor refactoring (#5544)

Co-authored-by: Dmitriy Labuzov <dlabuzov@yieldmo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants