Fix performance regressions #24

Closed
opened 2026-07-25 15:28:26 +02:00 by vegardbm · 2 comments
Owner

Several regressions in performance after switching to CBZ.
Most importantly it takes a heck of a long time to load a comic and to go back to the overview.
Startup time is pretty bad.

Several regressions in performance after switching to CBZ. Most importantly it takes a heck of a long time to load a comic and to go back to the overview. Startup time is pretty bad.
vegardbm added the performance label 2026-07-25 15:28:26 +02:00
Author
Owner

I found one important code snippet which causes most of the performance regression:

for volume in metadata.volumes {
    for chapter in volume.chapters {
        sum += chapter.images.count
    }
}
I found one important code snippet which causes most of the performance regression: ```swift for volume in metadata.volumes { for chapter in volume.chapters { sum += chapter.images.count } } ```
Author
Owner

The reason this is an issue is a combination of the method where this snippet resides is called often, the accesses are not cheap because they have significant indirection. The access is related to how flatbuffers work.

The reason this is an issue is a combination of the method where this snippet resides is called often, the accesses are not cheap because they have significant indirection. The access is related to how flatbuffers work.
Sign in to join this conversation.