Open mxtlrr opened 1 month ago
$f(2,5)$ was computed in 113s while $f(2,4)$ was computed in 0.29s. From other tests, it seems like BOTH operations are slow!
Operation | Time |
---|---|
$\sum_{n=1}^{50}{2}$ | ~0.36s |
$\prod_{n=1}^{50}{2}$ | ~0.21s |
Sadly, javascript is not really multithreaded -- this means we might have to go back to our roots in C++.
An updated table of JS rewrite's timing function (lowest was taken): | Function $f$ | Time |
---|---|---|
$f(2,1)$ | 0.1559s | |
$f(2,2)$ | 0.0179s | |
$f(2,3)$ | 0.0090s | |
$f(2,4)$ | 0.2699s | |
$f(2,5)$ | 69.401s | |
$f(2,6)$ | Unknown $^1$ |
$^1$: $f(2,6)$ has never been computed with treng yet.
treng
has gone through a rewrite from C++ to JavaScript, the JavaScript rewrite is actually slower!Obviously, the data shows that JS may not be the perfect language for this. However, this also may be due to unoptimized functions (#1), but it also may be that string operations where the length of the string $n$ is $> 10^{50}$ digits. This issue is only here to document a potential rewrite / optimizations of other functions that do not fit into pre-existing issues.