@kadei while true; do mkdir --rate ☹; sleep 1; done
Conversation
Notices
-
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Friday, 23-Aug-2024 02:40:48 JST Haelwenn /элвэн/ :triskell: - Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.
- Pleroma-tan repeated this.
-
Embed this notice
dpflug (dpflug@hachyderm.io)'s status on Friday, 23-Aug-2024 08:51:54 JST dpflug @lanodan @kadei `mkdir () { mkdir $1 && mkdir --rate ☺ || mkdir --rate ☹`
-
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Friday, 23-Aug-2024 20:08:43 JST 翠星石 @lanodan @kadei Too slow;
#include <stdlib.h>
int main(){while (1){system("mkdir --rate ☹");}}Pleroma-tan likes this. -
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Friday, 23-Aug-2024 20:17:30 JST Pleroma-tan @Suiseiseki @kadei @lanodan omit the type in main to get the compiler warning and it's perfect -
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Friday, 23-Aug-2024 20:23:30 JST 翠星石 @kadei It's hardly slower when you can't even kill it with C-c and have to find the pid and `kill -9`. -
Embed this notice
kadei 🐀 (kadei@furry.engineer)'s status on Friday, 23-Aug-2024 20:23:31 JST kadei 🐀 @Suiseiseki @lanodan I think that'd be slower (other than omitting the sleep) since each system() spawns a fresh shell process
-
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Friday, 23-Aug-2024 22:20:43 JST Haelwenn /элвэн/ :triskell: @kadei @Suiseiseki Yeah, posix_spawn would make more sense, but shells are typically fast enough if all you want to do is execute a ton of commands. After all it can DoS the whole system with a simple forkbomb. -
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Friday, 23-Aug-2024 23:13:19 JST Haelwenn /элвэн/ :triskell: $ clang -O2 -Wall -Wextra -o 1000 1000.c -static $ dumbbench --float -s ./1000 | tail -n 3 1000 cmd: Ran 20 iterations (0 outliers). cmd: Rounded run time per iteration (seconds): 0.614800 +/- 0.002500 (0.4%) $ dumbbench --float -s dash ./1000.sh | tail -n 3 1000 cmd: Ran 20 iterations (0 outliers). cmd: Rounded run time per iteration (seconds): 0.757000 +/- 0.021000 (2.8%) So even with the cost of launching a shell it's still reasonably fast.
1000.c
1000.sh