There isn't a performance improvement. There might be a degredation from too generic a netmask. The netmask helps identify what IP address ranges your device can directly connect to. If you have a 192.168.1.x IP address then the only possible IP addresses your home router will provide are 192.168.1.n and a final ".0" netmask will allow your device to connect directly to all possible IP addresses your router could manage. If you have a router that can generate IPs in the 192.168.1.n to 192.168.2.n then you need a netmask that will allow your device to connect to any of those IP addresses.
If you connect to your modem directly, you should use whatever the DHCP server provides. Unless you are setting a static IP address, there is no reason to manually set a netmask.