xp-framework / http

HTTP protocol support for the XP Framework
2 stars 2 forks source link

Performance with CURL #21

Open thekid opened 6 years ago

thekid commented 6 years ago

Via https://github.com/xp-forge/neo4j/pull/3

# With Sockets
$ xp test.script.php xp-forge/neo4j http://discovery:...@127.0.0.1:7474
[xp-forge/neo4j, http * 100] returns << [:var]
0.601 seconds, 1770.47 kB

# With CURL
$ xp test.script.php xp-forge/neo4j http://discovery:...@127.0.0.1:7474
[xp-forge/neo4j, http * 100] returns << [:var]
0.326 seconds, 1754.30 kB

Clearly, either the CURL transport should be preferred or the socket implementation's performance should be improved upon!

thekid commented 6 years ago

The code reads CURL is the slower one, so favor SSLSockets - hrm, seems no longer to be true 😄

thekid commented 6 years ago

Using Connection: keep-alive, I can get that figure down to 0.185 seconds, 1776.46 kB 👍