Method calls are very slow

CryptoFutureCryptoFuture Member Posts: 44
When trying to call a method of a contract, it can take around one second to get a response.

This is particularly slow when I have to call 50+ objects from contract storage. Is there a faster way to do this?

Comments

  • feindurafeindura BerlinMember Posts: 7
    It should be fast, are you using a local node or a remote one?
  • PranayPranay Member Posts: 58
    which block you are using? If you are using test net than it should really fast, because there a lot miners.
  • CryptoFutureCryptoFuture Member Posts: 44
    I'm using the olympus chain with a local node. The set up I have a local nodejs script doing a RPC connection to my local geth node.
  • PranayPranay Member Posts: 58
    Did you check with system configuration?
  • CryptoFutureCryptoFuture Member Posts: 44
    edited May 2015
    Here is a test I ran. You can paste it directly into your geth console. It does 100 calls to the registrar contract. It takes 7+ seconds to complete on my machine. Is this meant to be faster? I was hoping 100 simple calls could be done in milliseconds
    
    var doTests = function(amount) {
    	var testCall = function(address) {
    		var beforeCall = new Date();
    		var name = registrar.name.call(address);
    		if (name) {
    			time = new Date(new Date().getTime() - beforeCall.getTime()).getTime() / 1000;
    			console.log("got result in "+time+" seconds");
    		}
    	}
    
    	var before = new Date();
    
    	for (var i=0; i
Sign In or Register to comment.