telegram-cloud icon indicating copy to clipboard operation
telegram-cloud copied to clipboard

Speed issue.

Open mishailovic opened this issue 4 years ago • 13 comments

I ran several tests on my virtual server with 2 gigabit internet, and I came to the conclusion that the speed problem is in telethon itself. I wrote a small benchmark: https://gist.github.com/mishailovic/3bc25bb644642acf371e732f2dafa52f and the pyrogram speed was almost three times faster.

Pyrogram stats: speed - 168.88 Mbps, time - 71 s
Telethon stats: speed - 55.85 Mbps, time - 215 s

I think it would be nice to rewrite the scripts in pyrogram.

mishailovic avatar May 30 '21 07:05 mishailovic

Wow, It was a great comparison. 🤔 I really like to switch on Pyrogram but I can't do this soon because of my hand problem. It worth migrating to Pyrogram instead of cleaning and rewriting the whole package, because my codes are suck and really dirty... BTW I will be happy if you give me a hand. And again thanks for your useful comparison. 🤗

iw4p avatar May 31 '21 15:05 iw4p

I'll do a couple more tests, maybe it's a problem of my server, or something else. I hope if I pass the exams successfully, I will definitely help you 😁

mishailovic avatar May 31 '21 15:05 mishailovic

Hmm, I knew the Telethon is slow even with cryptg package, have you ever checked it out? But I've never use Pyrogram, I just heard about that. Thanks 😛, I've to rest for a month... After that, I'll back to my keyboard. Do you need my Telegram ID?

iw4p avatar May 31 '21 15:05 iw4p

I think yes, if I need to write to you about anything, I will text you inside Telegram

mishailovic avatar May 31 '21 15:05 mishailovic

Sure, text me Here

iw4p avatar May 31 '21 18:05 iw4p

Hey! It's me again. So, thought that it is better not to rewrite the entire project to another library, it will take a lot of time and effort, and will not give the desired result. Instead, I decided to do parallel uploading via telethon, and here are the results I have achieved: Снимок экрана 2021-06-01 в 11 33 55

I used code from this gist: https://gist.github.com/painor/7e74de80ae0c819d3e9abcf9989a8dd6/

mishailovic avatar Jun 01 '21 08:06 mishailovic

Hello again, Seems it’s faster than Pyrogram, isn’t it? Also I fixed the link of Telegram ID, now you can text me

iw4p avatar Jun 01 '21 09:06 iw4p

Seems it’s faster than Pyrogram, isn’t it?

This is not entirely true, I think it is possible to implement parallel uploading in pyrogram, but I have no idea how to do it.

Also I fixed the link of Telegram ID, now you can text me

I know, I just want the discussion to be public, if someone wants to join

mishailovic avatar Jun 01 '21 09:06 mishailovic

Yes the better idea is implements pyrogram with parallel uploading, I have to check the codes carefully and I think it’s possible. And also I have to decide about making another python package or mixing them together.

iw4p avatar Jun 01 '21 09:06 iw4p

Good luck!

mishailovic avatar Jun 01 '21 10:06 mishailovic

Thanks buddy 🙏🏻

iw4p avatar Jun 01 '21 10:06 iw4p

The discussion is too interesting !!

prof-kicks avatar Jun 12 '21 12:06 prof-kicks

The discussion is too interesting !!

It will be even more interesting if implemented‌ 👻

iw4p avatar Jun 12 '21 13:06 iw4p