Neo4J Job execution time

試著忘記壹切 提交于 2019-12-25 02:57:58

问题


I am trying to record the Neo4J algorithm execution. I run an algorithm 10 times, however the first run is always significantly longer than the rest of executions. For example:

elapsed time = | 86345.0 | 3417.0 | 3416.0 | 4228.0 | 3369.0 | 3323.0 | 3338.0 | 3370.0 | 3775.0 | 3370.0 //ms

Why is this happening? Is Neo4J smart enough to store already visited (read from DB) vertices in memory, thus from the second execution it reads from memory not the database? My datasets are small enough to fit into memory (and a lot of space is left).


回答1:


Your assumption is correct. Neo4j uses caching on multiple levels:

  1. mapped memory cache
  2. object cache

The first run operates on cold caches, so all data must be read from I/O subsystem. Any subsequent access will then benefit from caches.

For a more in-depth explanation see http://docs.neo4j.org/chunked/stable/configuration-caches.html.



来源:https://stackoverflow.com/questions/15482616/neo4j-job-execution-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!