I have a bunch of unit tests where I test my implemented search logic, and the test setup is rather slow - ~1.1 seconds per test.
Basically what is happening is:
- Build test data to feed to ES ( ~70ms)
- Set up the ES index with the mapping I'll be using in production ( ~350ms)
- Bulk insert the test data (~90ms)
- Misc. other stuff
- Wait for the test data to become available to the query before starting the test. This is done by performing an empty search and checking that the hits total matches the amount of documents inserted and sleeping a bit before trying again if we don't have all documents ready for reading (~600ms)
So there are two big time blocks here: Setting up the index from the mapping and waiting for documents (in my test setup currently 2) to become available. Since the tests are sequential it would be really nice to speed things up as much as possible. Parallelizing the tests is currently out of the question, since this is a legacy code base and I still have large "Here be dragons" areas on the map.
I've already had a look at the performance tuning tips in the documentation, and disabling write throtteling brought the document wait time down by about 50ms (from previously 620ms to 570ms).
But everything else I've tried didn't have much effect (reducing shard size, disabling replication, moving the storage path to a ram disk).
Is there anything else I can try to speed things up? For example something like in RDBMS where you throw data consistency over board by disabling transaction safety.
Read/Write concurrency is not an issue for my test setup. The test environment uses an NVMe SSD as a storage path and I have lots of ram available (>32GB) if that helps.