B4J Question [ JServer ] Why is the Jserver latency so high (100 ms) , even though it is localhost?

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
hello guys, can anyone tell me why the Jserver latency is so high even though it is in "localhost"?

about 100 milliseconds
 

OliverA

Expert
Licensed User
Longtime User
Because you are in debug mode?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Please post logs as text instead of screenshots.
2. As the logs say, it is an emulated latency that is added by default in debug mode. It helps developers write optimized code. In most cases there will be some latency between the clients and the server.

It is probably a mistake to do, but you can disable it with:
B4X:
srvr.DebugNetworkLatency = 0
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
why would that interfere with the speed of the project?
In this case that is not the reason but non-legacy debug mode runs with a different architecture to a release mode program and that adds a lot of code and a lot of performance overhead to its execution. Only ever test performance in release mode.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Also remember that in debug, the web server is single threaded. This can cause some issues too - eg if you are making async multiple requests to the web server some may time out. For example I have one page which loads a graph with 20+ sets of data that are loaded individually via REST, in debug I will see some data not load the first time.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…