~welt/murse

e57770c4e95d351ce6f6151ee3f292b4621d5f60 — welt 19 days ago e2523ab
Fix download not ending, add benchmarks to README
2 files changed, 42 insertions(+), 11 deletions(-)

M README
M jobs.go
M README => README +29 -5
@@ 9,23 9,47 @@ backend to get around these limitations.

FEATURES:

Static builds:
This program uses pure-Go libraries. You can build purely static builds,
which means that deploying is simply a matter of copying the binary to
your server, and running it.
Updates:
Updating is much quicker as we only download the different files
between your currently installed revision and the latest one

Lightweight:
Lightweight and fast:
Since this is written in a compiled, lower level language, murse is
much faster than the Python implementation. It's been designed to be
quicker too, adjustments have been made that make is significantly
speedier.

According to my benchmarks, murse took about half the time to install
Open Fortress that ofatomic did. I ran both of these with eight threads
on a Ryzen 2700x with 16GB of RAM. I used the coreutils time command to
measure these. No other programs were running on the disk.

Although, ofatomic has an unfair advantage, because it crashed with
an error extremely close to the end (as in a hundred megs off).

"real" is the actual reaL world time it took.

ofatomic:
real    16m15.630s
user    1m32.739s
sys     0m22.652s

murse:
real    8m22.129s
user    1m28.769s
sys     0m33.338s

Cross-platform:
Of course, we have the usual suspects (Windows, Linux) but we also
support other operating systems, like FreeBSD. Hypothetically this will
run anywhere Go can. Although I'm not sure why you would want this
on NetBSD or something.

Static builds:
This program uses pure-Go libraries. You can build purely static builds,
which means that deploying is simply a matter of running the binary. No
more Python and Pip annoyances!

Compatability:
We try to include flags such that murse is backwards compatible with
scripts for ofatomic. There are some dummy flags though, because we

M jobs.go => jobs.go +13 -6
@@ 46,7 46,7 @@ func startDownloadVerify(files map[string]string, lfiles map[string]string) (boo
	}()

	// We're going to pause so that all jobs will be submitted by the time
	// any errors will occur
	// any errors will occur (when it starts)
	pctx, c := context.WithCancel(context.Background())
	wp.Pause(pctx)



@@ 57,12 57,13 @@ func startDownloadVerify(files map[string]string, lfiles map[string]string) (boo
			lv = &s
		}

		{
			// new scope since we're dealing with a closure
		{ // new scope since we're dealing with a closure

			// set variables within our scope to the outside one.
			k := k
			v := v
			lv := lv

			f := func() {
				err := downloadAndVerify(k, v, lv)
				if err != nil {


@@ 77,8 78,8 @@ func startDownloadVerify(files map[string]string, lfiles map[string]string) (boo
				}
			}
			wp.Submit(f)
			// end scope
		}

		} // end scope
	}

	// Unpause


@@ 90,8 91,14 @@ func startDownloadVerify(files map[string]string, lfiles map[string]string) (boo
	go func() {
		// hack, I'm going to fork the worker library so that
		// we can wait for a worker pool to stop instead of finish
		// its tasks using a function like WaitStop
		// its queue using a function like WaitStop
		for {
			if wp.WaitingQueueSize() == 0 && !wp.Stopped() {
				wp.Stop()
				donec <- true
				return
			}

			if wp.Stopped() {
				donec <- true
				return