barnumbirr / coinmarketcap

A python wrapper around the https://coinmarketcap.com API.
Apache License 2.0
436 stars 109 forks source link

Very very long answer #42

Closed Michelgard closed 6 years ago

Michelgard commented 6 years ago

Hello, I am under Debian8 and the answer is very long to come (about 1mn) ...

barnumbirr commented 6 years ago

I'm going to need more info:

Cheers.

Michelgard commented 6 years ago

what version of Python are you using? 2.7.9 what version of the library are you using? 5.0.3

barnumbirr commented 6 years ago

Hmmm, I don't seem to run into any performance issues. Running the following code takes around 590ms.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import time
from coinmarketcap import Market

def timing(f):
    def wrap(*args):
        time1 = time.time()
        ret = f(*args)
        time2 = time.time()
        print '%s function took %0.3f ms' % (f.func_name, (time2-time1)*1000.0)
        return ret
    return wrap

@timing
def do_work():
    coinmarketcap = Market()
    print coinmarketcap.ticker(start=0, limit=3, convert='EUR')

if __name__ == '__main__':
    do_work()

Can you try this out and tell me how long this takes for you?

Cheers.

Michelgard commented 6 years ago

Hello, Thanks for the test code. Actually I must have a problem on my server because I have: do_work function took 150902.367 ms I tested on another server and there: do_work function took 101.653 ms

On the other hand on the 1st server the call of the API in PHP is very fast ... so I have to see a problem rated Python.

Cheers.

barnumbirr commented 6 years ago

Considering the issue is not likely to be with the coinmarketcap library, can I close this issue @Michelgard ?

Cheers.

Michelgard commented 6 years ago

Yes thank you very much