diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-03-20 09:26:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-20 09:26:39 -0400 |
| commit | 52d7a3cd2b9b551b0e5e8d95a43ee8408484c133 (patch) | |
| tree | 39e8d59b266c2375fb3f8f3bcd14a6070ad4e310 /cmd/anubis/main.go | |
| parent | c81e938f63281dbe885f5d3e0ca842e2719de81c (diff) | |
| download | anubis-52d7a3cd2b9b551b0e5e8d95a43ee8408484c133.tar.xz anubis-52d7a3cd2b9b551b0e5e8d95a43ee8408484c133.zip | |
cmd/anubis: drastically optimize proof of work (#19)
* cmd/anubis: drastically optimize proof of work
Closes #12
Closes #17
This drastically optimizes the proof of work check by removing the
stringify call at every iteration. Additionally, this optimizes the
checks by running them in parallel for as many threads as the browser
has available (according to navigator.hardwareConcurrency).
This also changes the redirect lag to 250 milliseconds instead of 2000
milliseconds in order to be perceptually faster. This is below the
reaction time threshold of many people, so this will make the post-check
success phase perceptually instant.
Testing on an iPhone 7 Plus has shown that this can clear a difficulty 4
check in 3.4 seconds.
This actually optimizes the check so much it may be a logistical concern
for operators.
* cmd/anubis/js: fix happy cachebuster logic
Signed-off-by: Xe Iaso <me@xeiaso.net>
---------
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/anubis/main.go')
| -rw-r--r-- | cmd/anubis/main.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go index 45afeb2..c71d368 100644 --- a/cmd/anubis/main.go +++ b/cmd/anubis/main.go @@ -82,7 +82,7 @@ const ( ) //go:generate go tool github.com/a-h/templ/cmd/templ generate -//go:generate esbuild js/main.mjs --sourcemap --minify --bundle --outfile=static/js/main.mjs +//go:generate esbuild js/main.mjs --sourcemap --bundle --minify --outfile=static/js/main.mjs //go:generate gzip -f -k static/js/main.mjs //go:generate zstd -f -k --ultra -22 static/js/main.mjs //go:generate brotli -fZk static/js/main.mjs |
