since you wanted to Do it yourself
in python, this works to create the first derived address using my electrum xpub
from bitcoin import *
childkey1 = bip32_ckd('xpub_my_electrum_xpub', 0)
childkey2 = bip32_ckd(childkey1, 0)
key = bip32_extract_key(childkey2)
address = pubtoaddr(key)
print address
you'll need to put this one in a loop to browse trough all keys* , and bechmark it for speed tough... I have no idear if it's slower or faster for your implementation
* for example, the derivation of the second address would be:
from bitcoin import *
childkey1 = bip32_ckd('xpub_my_electrum_xpub', 0)
childkey2 = bip32_ckd(childkey1, 1)
key = bip32_extract_key(childkey2)
address = pubtoaddr(key)
print address
EDIT: was a bit bored at work (slow day), decided to do the next part of the work for you, and i updated my post accordingly from bitcoin import *
childkey1 = bip32_ckd('xpub_my_electrum_xpub', 0)
for counter in range(1000):
childkey2 = bip32_ckd(childkey1, counter)
key = bip32_extract_key(childkey2)
address = pubtoaddr(key)
print address
Takes 5.157 seconds to generate 1000 addresses
, since you mentioned your old script takes 0.1s/address, and you need 0.01s/address, i guess 0.0051 is well within the requested range (it's allmost 20 times faster instead of the requested 10 times)...
Second edit, since electrum uses m/0/<n> for receiving addresses, and m/1/<n> for change addresses, generating change addresses would be done by changing line
childkey1 = bip32_ckd('xpub_my_electrum_xpub', 0)
to
childkey1 = bip32_ckd('xpub_my_electrum_xpub', 1)