Quadratic processing time for array responses
See original GitHub issueConsider the following contract:
contract Test {
uint32 constant SIZE = // size here
uint256[SIZE] private array;
function get() external view returns (uint256[SIZE] memory) {
return array;
}
}
When SIZE is > ~1000 elements, the time spent waiting for a response to a web3 call() to get() starts to grow in a super-linear fashion.
NumElements: Time
1000: 1.0s 2000: 2.9s 3000: 5.6s 4000: 9.2s 5000: 13.9s 6000: 19.4s 7000: 25.9s
I’ve tested this both with the truffle web3js client as well as the rust-web3 client, both against ganache-cli and truffle develop and I see the same behavior. ganache-cli vs truffle develop have nearly the same response times, which makes leads me to believe there is some super-linear processing in ganache-core.
The cpu is spiked to 100% on a single core during the processing time.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How is union find quadratic algorithm? - java - Stack Overflow
Each invocation of union method requires you iterate over the id array, which takes O(n) time. If you invoke union method n times,...
Read more >4.1 Analysis of Algorithms - Introduction to Programming in Java
The quadratic algorithm will be fastest for n up to about 1000, and the linear algorithm will never be faster than the linearithmic...
Read more >Quadratic and Logarithmic Time Complexity - Data Structures ...
FREE Courses (100+ hours) - https://calcur.tech/all-in-ones Python Course - https://calcur.tech/python-courses✓ Data Structures ...
Read more >Algorithms in plain English: time complexity and Big-O notation
O(n² ) — Quadratic Time: Given an input of size n, the number of steps it takes to accomplish a task is square...
Read more >Signal Processing, IEEE Transactions on - CiteSeerX
quadratic processing is necessary for optimal performance. where is the length- complex array response vector. The vector contains all.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that geth does not seem to have this growth behavior, it seems to grow pretty linearly.
geth 1.10.6-stable, (both websockets & http)
@davidmurdoch So using node v14 improves the times more, but still same growth behavior. Both websockets and http have the same times.
ganache@canary, node v14.17.5 (both websockets & http)