Perhaps it would be helpful to give some concrete figures for the 
real-world application.

"the response time of Go API is higher than PHP" - how much? Are we 
talking, say, 1.2ms versus 1ms? Or 10ms versus 1ms? Is this testing between 
a client and server adjacent on the same LAN, or is the server running is a 
cloud somewhere?

"the response contains around 30k keys" - what's the total size of the 
response? Are the values for each key all simple strings?

Then, it would be useful to have small PHP and Go programs which reproduce 
the issue as seen, with data of this size.  You should prepare static data 
structures ready to be encoded for the response, so that you're only 
measuring the encoding and response time.

Then you could try pre-encoding the entire response to a JSON string, and 
return that string as the response, to eliminate the JSON encoding overhead.

Finally, it would be worth looking at the response using tcpdump or 
wireshark just to see if anything odd is happening, e.g. there is chunked 
encoding with lots of tiny chunks.

On Saturday 9 March 2024 at 05:31:32 UTC Mike Schinkel wrote:

> On Saturday, March 9, 2024 at 12:16:51 AM UTC-5 Robert Engels wrote:
>
> My guess is that most applications are decoding 25gb json files with any 
> regularity. Even transferring 25 GB over the fastest of networks takes 20 
> secs? So that reduces the cost to less than 10%???
>
>
> How about rather than guessing, you let the OP consider the input you gave 
> in your first reply — which I acknowledged was likely the issue in my first 
> reply — and then move on?
>
> This is either a troll post or by someone that needs more education in 
> performance monitoring. Sorry. 
>
>
> Everything beyond your first reply on this thread — except when you 
> replied to my ask for clarification — was unnecessary as you had already 
> made your only point.
>
> If there was trolling here, your reply to my first reply on the thread was 
> the start of that trolling.
>
> -Mike
>
> P.S. The types of replies you've made on this thread is why I always ask 
> myself if it worth the pain to answer someone's questions. Rest assured I 
> will think twice next time before going to the effort.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/579ea671-0140-4817-a7e9-8b995bbf9418n%40googlegroups.com.

Reply via email to