From edba9338dcc4f8bd1510cbeee589cd04a46f3c94 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Wed, 1 Sep 2021 08:58:09 +0000 Subject: [PATCH] deploy: 5f5e2ccf1a51016c85f42536bfdc7ed601181131 --- blog/index.html | 2 +- blog/pow-performance/index.html | 6 +++--- blog/sitemap.xml | 2 +- contributors/aravinth-manivannan/index.html | 2 +- sitemap.xml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/blog/index.html b/blog/index.html index 720bdc3..2d3d7e3 100644 --- a/blog/index.html +++ b/blog/index.html @@ -1,4 +1,4 @@ Blog - mCaptcha

Blog

PoW performance

PoW performance of native and WASM implementations. Does the native implementation have and edge over the WASM library?

Posted May 26, 2021 by Aravinth Manivannan ‐ 3 min read

Last Edited September 1, 2021

Say hello to mCaptcha

Introducing mCaptcha, a kickass CAPTCHA systems that gives (DDoS) attackers a run for their money. Oh and UX is great too!

Posted May 26, 2021 by Aravinth Manivannan ‐ 2 min read

Last Edited May 27, 2021

\ No newline at end of file +

Blog

PoW performance

PoW performance of native and WASM implementations. Does the native implementation have and edge over the WASM library?

Posted May 26, 2021 by Aravinth Manivannan ‐ 2 min read

Last Edited September 1, 2021

Say hello to mCaptcha

Introducing mCaptcha, a kickass CAPTCHA systems that gives (DDoS) attackers a run for their money. Oh and UX is great too!

Posted May 26, 2021 by Aravinth Manivannan ‐ 2 min read

Last Edited May 27, 2021

\ No newline at end of file diff --git a/blog/pow-performance/index.html b/blog/pow-performance/index.html index d625322..eb8265d 100644 --- a/blog/pow-performance/index.html +++ b/blog/pow-performance/index.html @@ -1,7 +1,7 @@ -PoW performance - mCaptcha

PoW performance

Posted May 26, 2021 by Aravinth Manivannan ‐ 2 min read

Last Edited September 1, 2021

We are mCaptcha. We build kickass CAPTCHA systems that gives (DDoS) attackers a run for their money. And we do all of this without tracking your users. Oh and did I mention our UX is great?

mCaptcha uses a proof-of-work(PoW) mechanism to rate limit users or potential bots. In order for this to be effective, the PoW should be configured properly. The difficulty @@ -12,7 +12,7 @@ capable of running in a multi-threaded context. This creates an unfair advantage for crackers using these bots over legitimate users, who usually use browsers to access a website.

I wanted to see how much of an advantage a native program would have over our WASM library.

Benchmark tools

So I wrote these to compare native and WASM performances:

Results

The tests were run on my development machine featuring an Intel Core -i7-9750h.

Native

DifficultyRealUserSys
500000m0.040s0m0.040s0m0.000s
3000000m0.122s0m0.122s0m0.000s
5500000m0.124s0m0.119s0m0.003s
8000000m0.123s0m0.118s0m0.003s
10500000m0.933s0m0.932s0m0.000s
13000000m1.227s-0m0.007s
15500000m1.260s0m1.256s0m0.003s
18000000m1.243s0m1.242s0m0.000s
20500000m2.524s0m2.510s0m0.000s
23000000m2.545s0m2.543s0m0.000s
25500000m2.561s0m2.551s0m0.004s
28000000m2.555s0m2.540s0m0.006s
30500000m2.513s0m2.508s0m0.000s
33000000m2.484s0m2.481s0m0.000s
35500000m2.643s0m2.642s0m0.000s
38000000m2.663s0m2.661s0m0.000s
40500000m2.663s0m2.660s0m0.000s
43000000m2.689s0m2.683s0m0.004s
45500000m2.688s0m2.686s0m0.000s
48000000m2.517s0m2.509s0m0.003s

Browser

I ran the tests on both Firefox and Chromium to compare results

Firefox

  • User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
  • Hardware concurrency: 12
DifficultyDuration(in ms)
500000401
1000000413
1500000398
2000000394
25000001495
30000001556
35000003971
40000004235
45000004116

To be fair, my Firefox installation is loaded with a gazillion +i7-9750h.

Native

DifficultyRealUserSys
5000000m0.220s0m0.197s0m0.006s
10000000m0.203s0m0.203s0m0.000s
15000000m0.198s0m0.198s0m0.000s
20000000m0.203s0m0.203s0m0.000s
25000000m0.758s0m0.752s0m0.003s
30000000m0.776s0m0.769s0m0.003s
35000000m2.010s0m1.998s0m0.000s
40000000m2.038s0m2.033s0m0.003s
45000000m2.014s0m2.013s0m0.000s

Browser

I ran the tests on both Firefox and Chromium to compare results

Firefox

  • User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
  • Hardware concurrency: 12
DifficultyDuration(in ms)
500000401
1000000413
1500000398
2000000394
25000001495
30000001556
35000003971
40000004235
45000004116

To be fair, my Firefox installation is loaded with a gazillion extensions while the Chromium instance is clean, as I don’t use it much

Chromium

  • User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
  • Hardware concurrency: 12
DifficultyDuration(in ms)
500000399.40000000037253
1000000354.6000000014901
1500000351.19999999925494
2000000353.80000000074506
25000001337.800000000745
30000001311.199999999255
35000003417.5999999996275
40000003488.800000000745
45000003458.2999999988824

Conclusion

At the highest difficulty factor, the native implementation was a almost second faster than the WASM library. But the fact that both of them were able diff --git a/blog/sitemap.xml b/blog/sitemap.xml index f352ef8..749fb88 100644 --- a/blog/sitemap.xml +++ b/blog/sitemap.xml @@ -1 +1 @@ -/blog/pow-performance/2021-09-01T13:46:31+05:30weekly0.5/blog/say-hello-to-mcaptcha/2021-05-27T18:12:01+05:30weekly0.5 \ No newline at end of file +/blog/pow-performance/2021-09-01T14:27:17+05:30weekly0.5/blog/say-hello-to-mcaptcha/2021-05-27T18:12:01+05:30weekly0.5 \ No newline at end of file diff --git a/contributors/aravinth-manivannan/index.html b/contributors/aravinth-manivannan/index.html index 024132d..31eaf3b 100644 --- a/contributors/aravinth-manivannan/index.html +++ b/contributors/aravinth-manivannan/index.html @@ -1,4 +1,4 @@ Aravinth Manivannan - mCaptcha

Aravinth Manivannan

Creator of mCaptcha.

@realaravinth

PoW performance

We are mCaptcha. We build kickass CAPTCHA systems that gives (DDoS) attackers a run for their money. And we do all of this without tracking your users. Oh and did I mention our UX is great?

Posted May 26, 2021 by Aravinth Manivannan ‐ 3 min read

Last Edited September 1, 2021

Say hello to mCaptcha

We are mCaptcha. We build kickass CAPTCHA systems that gives (DDoS) attackers a run for their money. And we do all of this without tracking your users. Oh and did I mention our UX is great?

Posted May 26, 2021 by Aravinth Manivannan ‐ 2 min read

Last Edited May 27, 2021

\ No newline at end of file +

Aravinth Manivannan

Creator of mCaptcha.

@realaravinth

PoW performance

We are mCaptcha. We build kickass CAPTCHA systems that gives (DDoS) attackers a run for their money. And we do all of this without tracking your users. Oh and did I mention our UX is great?

Posted May 26, 2021 by Aravinth Manivannan ‐ 2 min read

Last Edited September 1, 2021

Say hello to mCaptcha

We are mCaptcha. We build kickass CAPTCHA systems that gives (DDoS) attackers a run for their money. And we do all of this without tracking your users. Oh and did I mention our UX is great?

Posted May 26, 2021 by Aravinth Manivannan ‐ 2 min read

Last Edited May 27, 2021

\ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 0bc95f2..d015a0f 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -/blog/pow-performance/2021-09-01T13:46:31+05:30weekly0.5/blog/say-hello-to-mcaptcha/2021-05-27T18:12:01+05:30weekly0.5/docs/api/mcaptcha-system/2021-04-10T17:08:46+05:30weekly0.5/docs/self-hosted/getting-started/2021-07-21T15:49:53+05:30weekly0.5/docs/prologue/introduction/2021-07-21T15:49:53+05:30weekly0.5/docs/api/browser/2021-03-11T11:29:26+05:30weekly0.5/docs/self-hosted/docker/2021-07-21T15:49:53+05:30weekly0.5/docs/self-hosted/bare-metal/2021-07-21T15:49:53+05:30weekly0.5/docs/api/pow-sha256/2021-04-01T22:58:38+05:30weekly0.5/docs/self-hosted/dependencies/2021-07-21T15:49:53+05:30weekly0.5/docs/help/troubleshooting/2021-07-21T15:49:53+05:30weekly0.5/docs/help/faq/2021-07-21T15:49:53+05:30weekly0.5/about/2021-05-27T16:28:59+05:30weekly0.5/donate/2021-07-16T21:58:39+05:30weekly0.5/contributors/aravinth-manivannan/2021-05-26T14:18:41+05:30weekly0.5/contributors/2021-05-26T14:18:41+05:30weekly0.5/privacy-policy/2021-05-27T19:15:04+05:30weekly0.5/community/2021-05-27T18:12:01+05:30weekly0.5/security/2021-05-27T19:15:04+05:30weekly0.5/thanks/2021-05-27T20:25:33+05:30weekly0.5/2021-03-09T18:56:02+05:30weekly0.5/docs/help/2021-07-21T15:49:53+05:30weekly0.5/docs/prologue/2021-07-21T15:49:53+05:30weekly0.5/docs/api/2021-03-11T10:37:50+05:30weekly0.5/contact/2021-05-27T18:12:01+05:30weekly0.5/blog/2021-05-26T14:18:41+05:30weekly0.5/docs/2021-07-21T15:49:53+05:30weekly0.5/docs/self-hosted/2021-07-21T15:49:53+05:30weekly0.5 \ No newline at end of file +/blog/pow-performance/2021-09-01T14:27:17+05:30weekly0.5/blog/say-hello-to-mcaptcha/2021-05-27T18:12:01+05:30weekly0.5/docs/api/mcaptcha-system/2021-04-10T17:08:46+05:30weekly0.5/docs/self-hosted/getting-started/2021-07-21T15:49:53+05:30weekly0.5/docs/prologue/introduction/2021-07-21T15:49:53+05:30weekly0.5/docs/api/browser/2021-03-11T11:29:26+05:30weekly0.5/docs/self-hosted/docker/2021-07-21T15:49:53+05:30weekly0.5/docs/self-hosted/bare-metal/2021-07-21T15:49:53+05:30weekly0.5/docs/api/pow-sha256/2021-04-01T22:58:38+05:30weekly0.5/docs/self-hosted/dependencies/2021-07-21T15:49:53+05:30weekly0.5/docs/help/troubleshooting/2021-07-21T15:49:53+05:30weekly0.5/docs/help/faq/2021-07-21T15:49:53+05:30weekly0.5/about/2021-05-27T16:28:59+05:30weekly0.5/donate/2021-07-16T21:58:39+05:30weekly0.5/contributors/aravinth-manivannan/2021-05-26T14:18:41+05:30weekly0.5/contributors/2021-05-26T14:18:41+05:30weekly0.5/privacy-policy/2021-05-27T19:15:04+05:30weekly0.5/community/2021-05-27T18:12:01+05:30weekly0.5/security/2021-05-27T19:15:04+05:30weekly0.5/thanks/2021-05-27T20:25:33+05:30weekly0.5/2021-03-09T18:56:02+05:30weekly0.5/docs/help/2021-07-21T15:49:53+05:30weekly0.5/docs/prologue/2021-07-21T15:49:53+05:30weekly0.5/docs/api/2021-03-11T10:37:50+05:30weekly0.5/contact/2021-05-27T18:12:01+05:30weekly0.5/blog/2021-05-26T14:18:41+05:30weekly0.5/docs/2021-07-21T15:49:53+05:30weekly0.5/docs/self-hosted/2021-07-21T15:49:53+05:30weekly0.5 \ No newline at end of file