Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 401517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:02:28+00:00 2026-05-12T17:02:28+00:00

I’m experiencing some performance problems loading about 60 images from a SQLite3 table with

  • 0

I’m experiencing some performance problems loading about 60 images from a SQLite3 table with the following table:

select rowid, thumbnail
from my_table
where category_id = 4

I have an index on category_id, yet it takes about 2.5 seconds to load a table of 170 70×70 PNG images.

In my code, I create an NSMutableArray of objects representing each row, like this:

    Item* item = [[Item alloc] init];
    item.rowid = sqlite3_column_int( statement, 0 );

    int thumbnailLength = sqlite3_column_bytes( statement, 1 );
    NSData* data = [NSData dataWithBytes:sqlite3_column_blob( statement, 1 ) length:thumbnailLength];
    item.thumbnail = [[UIImage imageWithData:data] autorelease];

    [result addObject: item]

iPhoto can load an album with almost no visible loading time. Is there some SQLite3 trick that I’m missing that can boost performance here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:02:29+00:00Added an answer on May 12, 2026 at 5:02 pm

    I’m betting that the Photos application only loads the thumbnail images that are visible on screen at a given time, retrieving the others as you scroll down the list in your album. This is easy to do using Core Data in 3.x, NSFetchedResultsController, and its setFetchBatchSize: method. Manually implementing this using raw SQLite will take a lot more code, but it’s still doable. This approach has both loading-time and memory advantages.

    In my SQLite data accesses, I didn’t notice a significant load time pulling up to 17 150 x 50 PNG images from an SQLite database, so there’s the possibility something else is slowing you down. You might also try running Instruments and Shark on your data loading method to see if SQLite really is your bottleneck there. I had a case where I’d assumed it was, but it turned out I had an inefficient string processing routine that was what really slowed down my creation of objects from SQLite data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.