Git Product home page Git Product logo

sqlpotests's Introduction

SQLPOTests

SQLPOTests is an iPhone app that (as of this writing) allows you to get a feel for three different approaches to using SQLitePersistentObjects. The three approaches included are:

  • Loading all objects into an array
  • Using the +pairedArrays... method
  • Loading one object at a time, per table cell

I was prompted to create this application by discussion on the mailing list surrounding how to back a UITableView with SQLPO. pairedArrays did not seem like the best approach to me, for two reasons. First, JOINs are difficult. Second, you lose all the instance methods from the class.

I have not done any formal profiling, but initial results seem to show that loading one object at a time is by far the fastest way to switch into a UITableView backed by SQLPO. When scrolling, however, the UITableView backed by the results from pairedArrays is clearly the winner.

The Data

The data in this sample app consists of 500 Groomers, 5000 Pets, and 500 Persons. You can think of Pets as a join table between the two other tables. The table that the app displays lists Groomers sorted by company name, with a label for the number of Pets it has, and the name of the first customer (i.e., the name of the owner of the first Pet).

Clicking on a segment of the UISegmentedControl will change the table backing accordingly. It's not thread safe, so be sure not to click on a different segment while the activity indicator is visible.

Notes

See the output from rake -T. None of the rake tasks will work unless you've built and run the application.

TODO

  • Make it thread safe.
  • Add an index to the table, or create a new view with an indexed table, for comparison.

sqlpotests's People

Contributors

wzph avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

singsmlie

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.