Is it possible to disable a certain form of caching in RDF4J? #3621
-
Hello, I am a researcher at the University of Padua and I am testing the performances of certain databases such as RDF4J for a paper of mine. To be more precise, I am running the Java class that executes the query from my terminal. The class only executes the query once, then the connection to the database is closed. The same class, executed two times in a row, returns two different results (1s and 300ms, as I was saying). Another interesting thing that I noticed is that if I run the same class after a certain amount of time, it goes back to being executed in 1s (no other operation was done in the terminal during that time). It appears as if RDF4J is saving some information on disk or somewhere else (whatever that may be) that is deleted after a certain amount of time. Since I would like to avoid having in my measurements the effect generated by forms of caching, is there a way to disable this option, whatever this is? I hope I explained myself here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Great that you are benchmarking RDF4J! RDF4J doesn't cache the query results between queries (except for the ElasticsearchStore). The NativeStore has a number of caches for reducing IO during read and write operations. Some of these are configurable while others are not. Here are some that are configurable: Your operating system also has a disk cache, which will affect your performance. Your CPU also has a number of caches that will affect your performance too. Do keep in mind that the Java Virtual Machine uses just-in-time compilation, so you need to warm up the system before you can make any measurements. Take a look at the OpenJDK Java Microbenchmarking Harness: https://github.com/openjdk/jmh Lastly I would like to point out that caching is a fundamental aspect to any DB. Disabling caching will make your results very unrealistic and not reflect the performance that a user experiences. |
Beta Was this translation helpful? Give feedback.
Great that you are benchmarking RDF4J!
RDF4J doesn't cache the query results between queries (except for the ElasticsearchStore).
The NativeStore has a number of caches for reducing IO during read and write operations. Some of these are configurable while others are not. Here are some that are configurable:
Your operating system also has a disk cache, which will affect your performance. Your CPU also has a number of caches that will affect your performance too.
Do keep in mind that the Java Virtual Machine uses just-in-time compilation, so you need to warm up the system before you can make any measurements. Take a look …