5

How does the performance of db.get() compare with that of db.get_by_key_name()?

Matthew H
  • 5,831
  • 8
  • 47
  • 82

2 Answers2

5

get_by_key_name must compute the keys based on app, model, name and parent, so it should consume a (tiny but not null) amount of CPU more than db.get, which needs no computation. However I doubt you can measure the difference in elapsed time, since the fetching from storage will vastly dominate in both cases.

Alex Martelli
  • 854,459
  • 170
  • 1,222
  • 1,395
4

For all intents and purposes they are equivalent.

Matt Williamson
  • 39,165
  • 10
  • 64
  • 72