Is publishing to streams a very slow process or am I doing something wrong?

+2 votes
I'm publishing some random string data  to 7 different streams. When I subscribe to them, it takes about 22 seconds to publish 1k data. Without subscribing, it takes about 21 seconds.

The string data I publish is of length 5 and I'm using the Savoir (python wrapper) to interact with multichain API. Also, I'm using only a single node which I control from my local laptop.

You can also see my code in here: https://gist.github.com/TinfoilHat0/639163679aba65b51c18f732f862b040

What I wonder is, are these figures normal or am I interacting with streams in a wrong manner ?

Thanks in advance.
asked Aug 19, 2018 by TinfoilHat

1 Answer

+2 votes
 
Best answer
That code appears to be publishing 7000 items to the blockchain. Depending on your server performance you can expect between a few hundred to a thousand published items per second (if each one is in a separate transaction) so this looks in range.
answered Aug 19, 2018 by MultiChain
selected Aug 30, 2018 by TinfoilHat
Yes, it publishes 1k item to each stream so 7k items in total as there are 7 streams.
Do you have any suggestions to improve the loading performance? I tried publishing to all streams at once with a single tx using "createrawsendfrom" method but it makes the process even slower for some reason.
Did you try using createrawsendfrom with the 'send' value for the final action parameter? That allows you to publish to multiple streams in a single transaction and in a single step.
Thanks!  createrawsendfrom with the 'send'  reduced publish time almost to 1/5 of the regular publish.
Great, thanks for the update.
...