Proposal Progress: Compiling Time vs Number of Threads

in #witness-category22 days ago

Thanks for all the supporters for Proposal: Fixing Steemd Build Dependencies in the Latest OS

Progress Update

In PR 3705 the NUMBER_BUILD_THREADS is introduced. And in PR 3706, the basic CI has been added.

I've done a quick experiment by increasing the NUMBER_BUILD_THREADS from 1 to 5 on the github CI VMs, which has a 4 cores and 16 GB according to this

And here is the results:

02da40b07eb10996092532b8c3708324.png

It is obvious that we should set 4 threads to minimize the compilation time of steemd.
image.png

import matplotlib.pyplot as plt

# Data
threads = [1, 2, 3, 4, 5]
times_str = ["1h38m8s", "50m17s", "49m52s", "46m4s", "48m59s"]

def parse_time(t):
    h = m = s = 0
    if "h" in t:
        h = int(t.split("h")[0])
        t = t.split("h")[1]
    if "m" in t:
        m = int(t.split("m")[0])
        t = t.split("m")[1]
    if "s" in t:
        s = int(t.split("s")[0])
    return h*3600 + m*60 + s

times_sec = [parse_time(t) for t in times_str]

plt.figure()
plt.plot(threads, times_sec, marker='o')
plt.xlabel("Threads")
plt.ylabel("Build Time (seconds)")
plt.title("Steemd Build Time vs Threads")
plt.grid(True)

plt.tight_layout()
plt.show()

Stay tuned!

Steem to the Moon🚀!

Support me, thank you!

Why you should vote me? My contributions
Please vote me as a witness or set me as a proxy via https://steemitwallet.com/~witnesses

image.png