Fabulously-Optimized / fabulously-optimized

A simple Minecraft modpack focusing on performance and graphics enhancements.
https://download.fo
BSD 3-Clause "New" or "Revised" License
958 stars 86 forks source link

Fast IP Ping #915

Open ItsIgnacioPortal opened 2 days ago

ItsIgnacioPortal commented 2 days ago

CurseForge link

https://www.curseforge.com/minecraft/mc-mods/fast-ip-ping

CurseForge Mod Distribution

Allowed

Modrinth link

https://modrinth.com/mod/fast-ip-ping

Source/other link

https://github.com/Fallen-Breath/fast-ip-ping

Mod file size

10.3KB

License

(any other license)

What it does

pinging

Yeet the laggy reversed DNS lookup for literal IP server addresses

Extracted from the yeetServerIpReversedDnsLookup option in TweakerMore Mod

What & Why & How

For servers whose addresses are represented solely by a literal IP, e.g. 192.168.2.10:25565, disable reverse DNS lookups in the corresponding InetAddress object

Many non-loopback IPs lack associated domain names, which makes reverse lookups time-consuming

// java.net.InetAddress#getHostName(boolean)
String getHostName(boolean check) {
    if (holder().getHostName() == null) {  // It will be null if InetAddress.getByName() received a literal IP
        holder().hostName = InetAddress.getHostFromNameService(this, check);  // <-- takes forever
    }
    return holder().getHostName();
}

This option sets the domain of those servers directly to their IP, bypassing the reverse DNS check

This results in a 1s ~ 5s reduction in time for servers with literal IP address. Affects the following environments:

Environment

Why should it be in the modpack

It reduces the time it takes to check the status of LAN servers in the multiplayer menu.

Why shouldn't it be in the modpack

No response

Additional details

No response

TheBossMagnus commented 1 day ago

I don't personally think it's worth it... Minimal to no change to real word ux

ItsIgnacioPortal commented 1 day ago

I don't personally think it's worth it... Minimal to no change to real word ux

It's only 10KB and it shaves off several seconds. Considering that the average JPEG weighs about 50KB, there's little to no cost to adding this mod.

Even if this only affects LAN servers, for only 10KB I think it's worth adding. There are a lot of people who wait until the server status loads before clicking join.

Kichura commented 22 hours ago

Can't this be a feature in debugify or something else related instead?