It looks like a bug simply because it seems like all (perhaps only some?) threads are reparsing the RESTXQ files, even when the modified time has not changed, and other threads are blocked on the cache object that holds the results of the parse.
Your feedback is welcome if you should decide to go deeper into that issue (I didn’t spend much time yet, but I couldn’t confirm this so far in my tests).
When I run the query by itself, average time is anywhere from 300 ms - 800 ms, but when I run concurrently, things slow way down. Below is the percentile speeds output by Apache Benchmark:
300 ms-800 ms doesn’t sound that exciting; maybe we’d have some potential here to speed up things up. Have you done some profiling of single queries, too (either on XQuery or Java level), even if single queries turn out to be fast enough for you?