Neo4J作业执行时间 [英] Neo4J Job execution time

查看:185
本文介绍了Neo4J作业执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试记录Neo4J算法的执行情况.我运行了10次算法,但是第一次运行总是比其余的执行时间长得多.例如:

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

为什么会这样? Neo4J是否足够聪明,可以将已经访问过(从DB读取)的顶点存储在内存中,因此从第二次执行起它就从内存而不是数据库中读取?我的数据集足够小,可以放入内存(还有很多空间).

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).

推荐答案

您的假设是正确的. Neo4j在多个级别上使用缓存:

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

  1. 映射的内存缓存
  2. 对象缓存

第一次运行是在冷缓存上进行的,因此必须从I/O子系统读取所有数据.然后,任何后续访问都将受益于缓存.

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.

有关更深入的说明,请参见 http://docs.neo4j. org/chunked/stable/configuration-caches.html .

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

这篇关于Neo4J作业执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆