Luca Auer 06497622f6 Batch database operations during backup restore for improved performance (#3267)
* perf(backup): batch database operations during restore

Reduce overhead by chunking manga and repo restoration into
transactions of 100 entries. Categories now restored in a single
transaction. Optimized DatabaseHandler to reuse existing transaction
contexts instead of creating redundant nested ones.

Changed TransactionElement to internal to allow AndroidDatabaseHandler
to check transaction state from the same package.

* fix(backup): make restore progress and errors thread-safe

Use AtomicInteger for progress and synchronizedList for errors to
prevent race conditions during concurrent restoration coroutines.

* perf(backup): update progress notification only once per chunk

Reduce UI/IPC overhead by moving notification updates out of the inner
loop, triggering them only after each 100-item transaction chunk.

Reduced on my emulator from 46 seconds to 27

* fix: remove invalid awaitAsOne() call on insert() return type

categoriesQueries.insert() returns Long (the inserted row ID), not an
ExecutableQuery<T>, so awaitAsOne() is not applicable.

* fix(feedback): Use `CopyOnWriteArrayList` and kotlin `AtomicInt`, add a changelog entry

Note that using kotlin `AtomicInt` instead of java `AtomicInteger` requires opting into an experimental API.

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2026-06-23 19:45:25 +06:00
2024-12-06 23:03:00 +06:00
2026-06-23 19:39:13 +06:00
2026-06-16 19:38:10 +06:00
2020-01-11 16:13:08 -05:00
2026-06-17 02:40:35 +06:00
2024-08-19 12:51:37 +06:00
2026-06-19 13:08:20 +06:00
2026-06-19 13:08:20 +06:00
2025-08-07 20:48:44 +06:00

Mihon logo

Mihon App

Discover and read manga, webtoons, comics, and more easier than ever on your Android device.

Discord server GitHub downloads

CI License: Apache-2.0 Translation status

Download

Mihon Stable Mihon Beta

Requires Android 8.0 or higher.

Features

  • Local reading of content.
  • A configurable reader with multiple viewers, reading directions and other settings.
  • Tracker support: MyAnimeList, AniList, Kitsu, MangaUpdates, Shikimori, and Bangumi support.
  • Categories to organize your library.
  • Light and dark themes.
  • Schedule updating your library for new chapters.
  • Create backups locally to read offline or to your desired cloud service.
  • Plus much more...

Contributing

Code of conduct · Contributing guide

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Before reporting a new issue, take a look at the FAQ, the changelog and the already opened issues; if you got any questions, join our Discord server.

Repositories

mihonapp/website - GitHub mihonapp/bitmap.kt - GitHub

Credits

Thank you to all the people who have contributed!

Mihon app contributors

Disclaimer

The developer(s) of this application does not have any affiliation with the content providers available, and this application hosts zero content.

License

Copyright © 2015 Javier Tomás
Copyright © 2024 Mihon Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
S
Description
Mihon with BookOasis document reader and text reader customizations
Readme 77 MiB
2026-09-19 20:13:59 +09:00
Languages
Kotlin 100%