Wednesday 18 October 2017

Looking for inspiration on how to improve performance of my code

I am looking to optimize my script in order to perform better.Here is a short description of what it does:It subscribes to a socket-connection (pusher-client)This socket connection pushes items (jsons) to meI process it by comparing it to a JSON-Object of the format {'name':'price'}.If the item is <= the price of the "db" I make a buy-apicall.This is a simple get-request. In order to make this faster, I use keepalive. To have a connection that is already alive, I make periodic api-calls to another endpoint.Sidenote: The code runs on a linux VPS that is as close as possible to the server (if everything runs well, the items from the json arrive with a delay of ~9ms)Somebody still manages to be constantly faster as this is a first come first serve system. Is there any aspect that I did not think about?If I'm in the wrong place to ask such question, please redirect me to the right place. Because I also have no idea of where to ask programmingrelated questions. I'm an it student, and my friends (from uni) aren't into coding at all, so I'm left with the internet. And other than reddit, I found no place yet where people are actually active.

Submitted October 18, 2017 at 06:16PM by cephii2

No comments:

Post a Comment