Parameter name size influences the http request time?

3

Does an http request for a service have its performance (bandwidth consumption / internet / time) changed if the parameter names are large?

Example. Request POST with the following parameters

{
"IdUsuario": 30735209,
"IdProdutoBase": 2,
"JsonServico": {
    "IdCliente": 6,
    "Versao": "1.6.0"
  } 
}

The request would be faster if it were:

{
    "ius": 30735209,
    "ipb": 2,
    "jds": {
        "icl": 6,
        "vsa": "1.6.0"
      } 
}
    
asked by anonymous 19.11.2014 / 17:12

2 answers

1

Yes it changes the performance, slowing down, increasing processing and consuming more bandwidth,





but in this case at a whimsy level , as brhvitor6 commented.

The version with parameters with larger names will logically be larger, consequently it takes more time to be transferred and processed.

But like in this era of apps and 3G connections, we want to save every bit, so today we find tools that do bundle and minification of javascript, for example, to reduce traffic.

A good thing you're already doing, using JSON instead of an XML (which because of its opening and closing tags spend more bytes.

If you're happy and do not complicate your code with names like "ius" instead of "UserId", go ahead, but know that it will not change much and the effort of change may not be worth it. p>     

19.11.2014 / 17:33
1

Enable gzip compression on your server for best results. If you are still not satisfied with the size and time of parsing, you can experiment with other formats, preferably binaries, such as msgpack .

    
19.11.2014 / 18:26