ios - Benchmarking CoreData and Realm -


how can benchmark coredata , realm?

i've used unit testing , took more time realm database add 100,000 records of data compared coredata (which believe incorrect) , no didn't use inmemory because i'm concerned benchmarks being close reality possible.

so what's proper way benchmark database fetch/add/remove processes? xctest? instruments?

if xctest way, must've been testing wrong. believe realm should outperform coredata in @ least simple databases.

some general benchmarking questions:

  1. what compiler optimization level building with? building in "release" mode full optimizations best optimization setting closest match real world behavior you're seeing.
  2. are benchmarking in simulator or on real device? it's critical test on real ios device.
  3. how close benchmark code reflect real-world usage? synthetic benchmarks misleading unless great care taken reflect how libraries used in reality. example, realm's per-transaction overhead higher core data's because preserves isolation (the "i" in acid: e.g. no faults in realm). writes within transaction faster core data. queries faster in realm, graph traversals. creating lots of small transactions, or few large ones? of impacts performance characteristics.
  4. are accidentally measuring unrelated code in benchmarks? have ask, you'd surprised @ of benchmark code i've seen spending of time in nslog...

finally, xctest , instruments shouldn't drastically affect benchmark comparison in situations. i'd encourage @ instruments though confirm #4.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -