You are not logged in.
Pages: 1
Hello mORMot users,
I'm using my own OSRM routing service on my virtual machine.
I'm running an OSM query (someting like http://127.0.0.1:5000/route/v1/driving/...) over a delphi program (XE 6 Ent).
the CMD window show me the elapsed time (2 lines per call)
Examples:
[info] 23-05-2019 18:26:47 4.29234ms 127.0.0.1 - Mozilla/5.0 (Windows; mORMot 1.18 TWinHTTP) 200 /route/v1/driving/...
[info] 23-05-2019 18:26:48 5.1023ms 127.0.0.1 - Mozilla/5.0 (Windows; mORMot 1.18 TWinHTTP) 200 /route/v1/driving/...
[info] 23-05-2019 18:26:49 5.11134ms 127.0.0.1 - Mozilla/5.0 (Windows; mORMot 1.18 TWinHTTP) 200 /route/v1/driving/...
[info] 23-05-2019 18:26:50 4.87088ms 127.0.0.1 - Mozilla/5.0 (Windows; mORMot 1.18 TWinHTTP) 200 /route/v1/driving/...
The sum is arround 10 milliseconds.
The Delphi program is looking like that:
...
httpVar := 'http://127.0.0.1:5000/route/v1/driving/...';
Stopwatch := TStopwatch.StartNew;
JSONContent := _Json(TWinHTTP.Get(httpVar)); //JSONContent is mORMot RawJSON Type
Elapsed := Stopwatch.Elapsed;
MilliSeconds:=elapsed.Milliseconds;
MemResult.lines.Add(FloatToStr(MilliSeconds) + ' ms');
...
The elapsed time is arround 50 milliseconds.
Is this difference normal? Do I have a way to reduce this duration in Delphi?
Thanks.
Last edited by DKA (2019-05-23 16:52:12)
Offline
Thanks a lot MPV for answering.
First you are rigth about the measurement tool. Accurate for 1 call but not accurate for 1000 call.
Second, if I use TPrecisionTimer, the result is the same: 50 ms per call (cmd windows still showing 5 or 6 ms).
Offline
On the localhost/loopback interface, we should expect better numbers, you are right.
I have observed that TWinHTTP may be slower in some cases, due to some obscure Windows or AntiVirus security "features".
Try to use the client socket version instead - which is the best option for plain http over 127.0.0.1.
Offline
Thanks ab, I will check this.
Offline
Pages: 1