Open syahrul12345 opened 1 year ago
You seem to be measuring performance while compiling in debug mode. Try adding the --release
flag for much better performance?
Im using the release flags, but it really does nothing. Im also compiling using native cpu flags. Added some additional logs in my repo.
For example, a single websocket connect with 1000 requests takes almost 40 seconds to complete!
Time taken for websocket client index 0 request index 986 is 40.720993583s
Time taken for websocket client index 0 request index 970 is 40.721093416s
Time taken for websocket client index 0 request index 991 is 40.721256917s
Time taken for websocket client index 0 request index 898 is 40.72104225s
Time taken for websocket client index 0 request index 897 is 40.904411292s
Time taken for websocket client index 0 request index 993 is 40.948703334s
Time taken for websocket client index 0 request index 984 is 40.957841708s
Time taken for websocket client index 0 request index 988 is 40.957901209s
Time taken for websocket client index 0 request index 900 is 40.957975833s
Time taken for websocket client index 0 request index 989 is 40.957957125s
Command i use:
make build && ./target/release/async-eth --outer 1 --iterations 1000
Version 2.0.7
Platform MacOS Venture 13.3.1
Description Using a singular websocket connection, if a large number of requests are made, all requests are only completed after a long time. A total of 40,000 requests to will only finish after 90 seconds. I tried this code:
1) Clone this repo: https://github.com/syahrul12345/ethers-websockets-tests 2) Change .example.env to .env and provide your http and ws endpoints. (I am using reth) 3) Execute an individual benchmark by using this command
Logs: