Does parameter name size influence http request time?

Asked

Viewed 77 times

3

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

Example. Requisition POST with the following parameters

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

The requisition would go faster if it were:

{
    "ius": 30735209,
    "ipb": 2,
    "jds": {
        "icl": 6,
        "vsa": "1.6.0"
      } 
}
  • A totally ridiculous time. And it will only get worse in understanding the code

2 answers

1


Yes changes performance, slowing down, increasing processing and consuming more bandwidth, but it is in this case at a derisory level, as the brhvitor6 commented.

The version with parameters with larger names will logically be larger, hence it takes longer to be downloaded and processed.

But like this time of apps and 3G connections, we want to save every bit, so today we find tools that make Javascript Bundle and minification, for example, to reduce traffic.

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

If you’re happy and don’t complicate your code with names like "ius" instead of "idusuário," go ahead, more know that it won’t change much and the effort of change might not be worth it.

1

Enable gzip compression on your server that will get better results. If you’re still not satisfied with the size and time of the Parsing, you can try other formats, preferably binary, such as msgpack.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.