News for hackers. Stuff that matters.
Re:Telegram Login for Websites by kuschku on Wednesday February 07, 2018 @01:08PM (#16326593)
Don’t worry, most current message apps have code that horrible.

Be it matrix simply writing a HashMap into a file as "database" replacement https://github.com/matrix-org/matrix-android-sdk/blob/master...

Or Signal simply taking apart Android system structs with JNI, to get a file descriptor’s owner https://github.com/signalapp/Signal-Android/blob/master/jni/...

There’s lots of suboptimal code in messaging apps. All of them.

Re:Telegram Login for Websites by slowmotiony on Wednesday February 07, 2018 @01:39PM (#16326863)
Why do you need a database over a serialized object like a hashmap file if there is only one user and one device?
Re:Telegram Login for Websites by kuschku on Thursday February 08, 2018 @06:07AM (#16331427)
Because writing the entire dataset back out on every addition or removal is extremely wasteful.

The existing database implementations in the system do much less writes.

Doing such large, constant writes not only is slower, it also degrades the NAND.

Re:Telegram Login for Websites by slowmotiony on Saturday February 10, 2018 @01:49PM (#16348805)
Thank you