Looks like I'll have to 100% reimplement mastodon.py in asyncio

Follow

@r000t
Are you running into performance issues?

@matrix
Not at all.

It's kinda weird.... A few days ago, the streaming API was working very, very, very well. In mastodon.py, this is implemented as a separate thread that hits up a callback you specify.

Today, the app is locking up because Qt doesn't like setting parents across threads.

I'd rather not have threading, at least not this early in the app's development. In fact, by the time I have to push off tasks to separate threads, I'd like to outright use separate processes.

I don't think it'll take more than an hour or two to "port" this library.

@matrix A few days ago, I had 10 instances' public timelines running, and the application never used more than 5% of a single CPU core. It was usually below 1% of a single core.

@matrix justbtw, my mastodon.py is already lighter on memory, because the original author imported hashlib for blocking domains, and for no other purpose.

@r000t
Was there even an active blocklist? I once scrolled through the code and couldn't find it.

@matrix Three sha256 hashes. My copy has them commented, with this notice:

#"I know what I'll do, I'll check his copy of the mastodon.py code, to check if he removed the block, so I can call him a nazi! I am very intelligent." --you 2020

@r000t
Oh. Nice. I was just quickly scrolling for it and looking for domains. That's why I missed it.
Since they are sha256 hashes, I guess the only way to figure out which instances are they is brute force.

@matrix Which tbh is another reason I took it out. I don't know what sites are being blocked, I don't really know why they are being blocked (outside of a single paragraph saying "just trust us, they were super duper violent, please consider whether or not you trust us before removing the code"), and I will, of course, consider adding the code back in if I get a list of plaintexts for those hashes, and valid technical reasons for excluding them.

Dude also made it use a "new" exception, that's very unlikely to be properly handled, instead of using the module's specific exceptions that are likely to be handled properly by someone using the library.

@matrix I also kicked around waiting patiently for someone to complain, then putting it back in, with my own hashes, but use a password derivation function instead so bruting them isn't possible, and you do literally have to try them.

Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.