←back to thread

MacOS Catalina: Slow by Design?

(sigpipe.macromates.com)
2031 points jrk | 2 comments | | HN request time: 0.425s | source
1. parhamn ◴[] No.23274114[source]
I'm showing 20-200ms longer on first run of the exec. Modified the test script a bit to show that it doesn't happen again if you modify the executable's contents.

    echo $'#!/bin/sh\necho Hello' > /tmp/test.sh && \
    chmod a+x /tmp/test.sh && \
    time /tmp/test.sh && \
    time /tmp/test.sh && \
    echo 'echo Hello2' >> /tmp/test.sh && \
    time /tmp/test.sh
replies(1): >>23274720 #
2. eugenekolo ◴[] No.23274720[source]
Another slight modification to make this show the effect every time:

    f=$(mktemp) && \
    echo $'#!/bin/sh\necho Hello' > $f && \
    chmod a+x $f && \
    time $f && \
    time $f && \
    echo 'echo Hello2' >> $f && \
    time $f

On my system:

    Hello

    real 0m0.131s
    user 0m0.001s
    sys 0m0.002s
    Hello

    real 0m0.004s
    user 0m0.001s
    sys 0m0.002s
    Hello
    Hello2

    real 0m0.004s
    user 0m0.001s
    sys 0m0.002s