What happens when a strategy loop is used once and then neglected?

Author: It's like water., Created: 2023-11-12 15:00:24, Updated:

I'm going to teach you guys how it happens when you use a strategy loop once, sometimes 60ms at a time, sometimes 10,000+ms at a time, and then you're going to have to go through a lot of different strategies. I timed each function internally, and found that when I was little, all functions were small, and when I was big, all functions were big. And one feature is to update the chart information, the status bar information takes longer to use than the market information =。= Is this caused by the cloud server, using Amazon's t2.micro.


More

Help (click on the image to get in touch)The graph state bar is theoretically just a demonstration that the slow cause should be the network IO, running the network IO parts in the loop as concurrently as possible

The Little DreamIs it real or retested? The content of the status bar is refreshed frequently, and the refresh rate is not fast, so the content displayed is not immediately displayed the current status bar content. The real-time consumption is basically generated by network IO requests, other operation time can be largely ignored.

Skin that is oldUpdate chart information, state bar information can be used with multiple threads

The Little DreamReduce the for loop to 10 times and observe again.

It's like water.I've found that one place takes longer, and the for loop ends up being 220+, what's the reason? var A = new Date (().getTime (() is the current time var B is equal to 0 var C is equal to 0. for (var i = 0; i < 1000; i++) { // all the computations inside the loop. B=new Date (().getTime (() -A) is the current date. I'm not sure. C=new Date (().getTime (() -A) is the current date. // output B is equal to 6 and C is equal to 220+ I'm just taking my time, I don't know if there's a problem.

It's like water.Thank you.

The Little DreamIt is said that without a network IO, it will not take much time, usually in a few milliseconds. Instead of a simple test scenario, rule out whether the problem is caused by strategic design.

It's like water.It's a real disk, and I've calculated that when I use it, it's always small and large. It's not just a state bar, all the functions take basically the same amount of time.

It's like water.Thank you for your thoughts QAQ