xaizek / etabench (License: GPLv3) (since 2022-09-08)
Benchmark for algorithms that compute I/O ETA
Commit 0f2a4fa0f0abd6186a1d1b4b7398c2a31db4c972

Fix Smoothing algorithm and enable it by default
It's not the worst one, implementation was just broken.
Author: xaizek
Author date (UTC): 2022-12-30 17:38
Committer name: xaizek
Committer date (UTC): 2022-12-30 18:23
Parent(s): 67c268da8e19e86e4fd93ecca88fee6237b8c796
Signing key: 99DC5E4DB05F6BE2
Tree: 270731a67b58d7bdeee7a9e55e7054726a477a70
File Lines added Lines deleted
src/algs.cpp 5 1
src/etabench.cpp 2 2
File src/algs.cpp changed (mode: 100644) (index 1fae56c..5b54826)
... ... SmoothingAlg::estimate(int current, int total, int time)
419 419 { {
420 420 float v = float(current - lastProgress)/(time - lastTime); float v = float(current - lastProgress)/(time - lastTime);
421 421 float a = alpha/100.0f; float a = alpha/100.0f;
422 speed = v*a + speed*(1.0f - a);
422
423 if (lastTime == 0)
424 speed = v;
425 else
426 speed = v*a + speed*(1.0f - a);
423 427
424 428 int eta = (floatEq<0.1f>(speed, 0) ? lastEta : (total - current)/speed); int eta = (floatEq<0.1f>(speed, 0) ? lastEta : (total - current)/speed);
425 429
File src/etabench.cpp changed (mode: 100644) (index 7b9a769..2384632)
... ... main(int argc, char *argv[])
97 97 std::make_unique<GravityAlg>(), std::make_unique<GravityAlg>(),
98 98 std::make_unique<ImmediateAlg>(), std::make_unique<ImmediateAlg>(),
99 99 std::make_unique<LookBackAlg>(20), std::make_unique<LookBackAlg>(20),
100 std::make_unique<SmoothingAlg>(10),
100 101 std::make_unique<SwitchAlg>(), std::make_unique<SwitchAlg>(),
101 102 std::make_unique<WindowAlg>(20, 1.0f) std::make_unique<WindowAlg>(20, 1.0f)
102 103 ); );
 
... ... main(int argc, char *argv[])
109 110 )), )),
110 111 std::make_unique<ExponentialAlg>(1), std::make_unique<ExponentialAlg>(1),
111 112 std::make_unique<ImmChangeLimitAlg>(), std::make_unique<ImmChangeLimitAlg>(),
112 std::make_unique<SlownessAlg>(1),
113 std::make_unique<SmoothingAlg>(10)
113 std::make_unique<SlownessAlg>(1)
114 114 ); );
115 115
116 116 auto profs = make_unique_vector<Profile>( auto profs = make_unique_vector<Profile>(
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/etabench

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/etabench

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master