nextclade icon indicating copy to clipboard operation
nextclade copied to clipboard

ENH: Empirically determine optimal number of threads for Nextclade web

Open corneliusroemer opened this issue 2 years ago • 2 comments

It seems that Nextclade web may not necessarily get faster after a certain number of threads is reached.

In particular, it may even get slower, as the setup time seems to increase with the number of threads.

It may be interesting to run a small experiment with a small matrix to find out how startup and processing time depends on number of threads and use the results to choose/recommend good defaults. This is somewhat related to #717

Matrix could be: (10,100 seqs) x (2,4,8 threads) x (Firefox, Chrome) x (Windows, Mac, Unix) x (slow, fast)

corneliusroemer avatar Feb 10 '22 09:02 corneliusroemer

setup time seems to increase with the number of threads

This is surprising to me and should not be the case. So probably a bug on its own.

small matrix to find out how startup and processing time depends on number of threads

Multiply this by number of relevant (and irrelevant) versions of browsers and different variations of number of tabs users have opened (including a couple of tabs of Nextclade from 2020), while also running pango and mining crypto, doing all that on a 4 Gb RAM Chromebook

ivan-aksamentov avatar Feb 10 '22 09:02 ivan-aksamentov

Richard wrote this on Slack:

Running it on one thread is about as a fast as allowing 8 threads for the 91 sequence data set since the init is faster.... we might actually benefit from setting the default number of threads to 2 or 4 rather than the max number available. Faster for moderate numbers of sequences in my case.

corneliusroemer avatar Feb 10 '22 10:02 corneliusroemer

The default number of threads is now 3 (https://github.com/nextstrain/nextclade/pull/1021). It is deduced by the thorough empirical study, I promise ;)

As usual, it can always be changed in settings if someone disagrees.

ivan-aksamentov avatar Jan 27 '23 21:01 ivan-aksamentov