Datastore fetch VS fetch(keys_only=True) then get_multi

后端 未结 1 1517
故里飘歌
故里飘歌 2021-01-22 08:04

I am fetching multiple entities 100+ from datastore using the below Query

return entity.query(ancestor = ancestorKey).filter(entity<

1条回答
  •  攒了一身酷
    2021-01-22 08:50

    FWIW, you shouldn't expect meaningful results from datastore performance tests performed locally, using either the development server or the datastore emulator - they're just emulators, they don't have the same performance (or even the 100% equivalent functionality) as the real datastore.

    Credit goes to @snakecharmerb, who correctly identified the culprit, confirmed by OP:

    Be aware that performance characteristics in the cloud may differ from those on your local machine. You really want to be running these tests in the cloud. – snakecharmerb yesterday

    @snakecharmerb you were right on your suggestion! Just tested on the cloud it's actually the other way around on the cloud in terms of performance. fetch() ~550ms, fetch(keysonly) then get_multi was ~700ms seems that fetch() works better on the cloud! – Khaled yesterday

    0 讨论(0)
提交回复
热议问题