Hacker News new | past | comments | ask | show | jobs | submit login

I'm a little late to the party, but I ran the benchmark inserts with cached statements on both my Macbook Pro and my iPhone 5S. sqlite definitely fairs better under this scenario.

That being said I still find the speed of Realm pretty impressive. And it's hard to gauge real world performance from this test. In my experience the real bottle necks around insert are upsets and establishing maintaining relationships.

For reference here are the benchmarks without reusing sqlite statements.

  Macbook Pro - Realm: 0.780414 sqlite: 0.464804 FMDB: 0.654659 
  iPhone 5S   - Realm: 2.235381 sqlite: 2.786381 FMDB: 3.336679
And with statement reuse

  Macbook Pro - Realm: 0.766406 sqlite: 0.189747 FMDB: 0.683823 
  iPhone 5S   - Realm: 2.214847 sqlite: 0.991864 FMDB: 2.832800
Interesting side note: FMDB seems to be spending just as much time finding the cached statement as sqlite takes to prepare a new one. I didn't expect that. I haven't dug into it at all, but I wouldn't be surprised if this due to the fact that the insert statement is relatively simple.

EDIT: Just fixed up formatting for the results




That's pretty cool, and roughly what I saw in my emulator - maybe my fumbling actually did it right :) And very much agreed, Realm is pretty impressive, and micro-benchmarks like this aren't all that useful.

Have you set up a pull request / issue by any chance? It paints Realm in a bit worse of a light, but hopefully they'll merge it in and update the site.


I didn't see the benchmark code in the repo, so I didn't really think about a pull request. Next time I find time I'll poke around a bit more. They are trivial changes though.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: