Ver Fonte

Optimal thread count for aspnetcore plaintext (#3328)

Sébastien Ros há 7 anos atrás
pai
commit
5fa9fee9f2
1 ficheiros alterados com 17 adições e 1 exclusões
  1. 17 1
      frameworks/CSharp/aspnetcore/setup-plaintext.sh

+ 17 - 1
frameworks/CSharp/aspnetcore/setup-plaintext.sh

@@ -1,3 +1,19 @@
 #!/bin/bash
 
-source run-linux.sh plaintext $(($(nproc)*3/10))
+if [ "$(nproc)" -eq "80" ]
+then
+    threadCount=24
+fi
+
+if [ "$(nproc)" -eq "4" ]
+then
+    threadCount=2
+fi
+
+if [ -z "$threadCount" ]
+then
+    echo "Invalid thread count ($(nproc)), using default"
+    threadCount=2
+fi
+
+source run-linux.sh plaintext $threadCount