A
A
Andrey Okhotnikov2019-06-13 17:13:28
RESTful API
Andrey Okhotnikov, 2019-06-13 17:13:28

Data conversion rate from API?

I get an array of goods from the back (15 pieces), but the format of the received data does not quite suit me, so I throw the data into an adapter that converts the data into the form I need. The conversion takes from 0.01ms to 3.5ms. So the question is - is it normal to spend up to 3.5ms on such operations or is it better to fix the back so that it sends it right away in the right format?
Or what are the best practices in this case?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Robur, 2019-06-13
@tsepen

it is normal to spend up to 3.5ms on such operations

You are engaged in premature optimization (google)
Answer the question what problems it creates in your case - and it will become clear whether it is normal or not.
I'm sure that none :) and is unlikely to create - so that's fine.

I
Ivan Shumov, 2019-06-13
@inoise

The difference in processing most likely depends on the processor load, so I don’t think it’s a crime. The back is not obliged to give the format in a form convenient for you. Format conversion is generally absolutely normal because it is the basis for the existence of api, except for the moments when the BFF approach is used, and even then not always

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question