I want to estimate the mean difference of a variable between populations with some level of confidence and with a minimum number of samples collected. The populations share the same variance and distribution, which may look normal, bimodal, or whatever else. Right now, I use a t-test and collect 40 samples for each population to compensate for the fact that the distribution can be non-normal. I then look at the difference of means formula for t-tests to determine the mean difference's confidence interval. Typically this confidence interval is acceptably small. However, is there a way I can do this using fewer samples? Can I leverage the fact that I know the distribution precisely?
The specific use case is that I'm making a startup-time benchmarking tool that takes two versions of an application, the control version and the experimental version, and benchmarks each by recording their startup time $N$ times, and reports if the experimental version has a significantly slower or faster startup than that of the control. It has to be run quickly, meaning with as few samples as possible, to give users results in an acceptable amount of time. The application's variance and distribution changes very little over any 24-hour span, so every 24 hours I can get a large dataset for the latest version of the application, e.g. with 1,000 startup times, and use that for the next 24 hours for all versions of the application. However, over the past few years, the distribution has slowly gone between normal, bi-modal, and other sorts, so it's not very stable beyond 24 hours.