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

Production builds should not include LinkConditionerConfig #65

Open
connorcarpenter opened this issue May 25, 2022 · 4 comments
Open

Production builds should not include LinkConditionerConfig #65

connorcarpenter opened this issue May 25, 2022 · 4 comments
Labels
feature desired new functionality naia socket pertaining to naia_socket crates

Comments

@connorcarpenter
Copy link
Member

Conditionally compile LinkConditionerConfig so that no conditioning is enabled for release builds

@connorcarpenter connorcarpenter added naia socket pertaining to naia_socket crates feature desired new functionality labels May 25, 2022
@BrandonDyer64
Copy link

I disagree. I need to be able to use the conditioner in release mode.

It should be up to the developer to decide when and how the conditioner should be disabled.

@connorcarpenter
Copy link
Member Author

Thank you for your feedback Brandon, fair enough 👍
May I ask why exactly you are wanting to use the link conditioner in release mode?

@BrandonDyer64
Copy link

My app uses video encoding, which is really only performant in release mode, and I use naia to send the compressed packets. It's definitely a good idea to prioritize keeping the conditioner out of production builds, but I would like to retain the option of having it enabled for --release.

I think it would be worthwhile (as an alternative) to include an example of how to disable it in the demos.

demos/bevy/shared/src/shared.rs

pub fn shared_config() -> SharedConfig<Channels> {
    // Set tick rate to ~60 FPS
    let tick_interval = Some(Duration::from_millis(20));

    // Use conditioner in debug mode
    #[cfg(debug_assertions)]
    let link_condition = Some(LinkConditionerConfig::average_condition());

    // Not in release mode
    #[cfg(not(debug_assertions))]
    let link_condition = None;

    SharedConfig::new(
        SocketConfig::new(link_condition, None),
        CHANNEL_CONFIG,
        tick_interval,
        None,
    )
}

@connorcarpenter
Copy link
Member Author

Got it, thank you for the context! 👍

@connorcarpenter connorcarpenter changed the title Release builds should not include LinkConditionerConfig Production builds should not include LinkConditionerConfig Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature desired new functionality naia socket pertaining to naia_socket crates
Projects
None yet
Development

No branches or pull requests

2 participants