We've noticed significant performance decreases when we move our AQL queries from ArangoDB's own REST API to a custom Foxx microservice. Is this to be expected?
For example, if we run a multithreaded load test from a remote machine that asks for the count of documents in an 800,000-document collection ("return LENGTH(MyCollection)") via the _api/cursor REST endpoint, we can process about 6,500 requests per second. If instead we call our own microservice that returns db._query('LENGTH(MyCollection)'), we can process only about 2,000 requests per second, a 69% decrease in throughput. (With a more complex query that does path traversals, we get a 32% decrease, and with a query that involves a geospatial index, the decrease is 60%.)
We're not sure what's causing this degradation. Any insight would be greatly appreciated.
Thanks!