System Info parameter very slow on Sierra

I have a script that pulls the machine name out of the (system info) parameter. Under El Capitan, this happened pretty much instantly. Since upgrading to Sierra, the command

get (system info)

takes 5 to 6 seconds to complete when run all by itself.

Anybody have any idea why and how to speed this back up?

Model: MacBook Pro Early 2011 SSD
Browser: Safari 602.2.14
Operating System: Mac OS X (10.10)

Hi rickoberndorf
I have just tested here on a 2013 macbook pro running sierra 10.12.1 running just the piece of code you supplied the result was pretty well much instant, no lags at all.

Try this as an alternative:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set hostName to current application's NSHost's currentHost()'s localizedName() as text


do shell script "hostname"

Thanks for the reply. Sometimes it runs fast for me, sometimes it takes 5-6 seconds. Does not seem to depend on other processes hogging resources or anything like that. Have no idea why fast sometimes and slow sometimes.

Thanks. That works for me. Runs quickly even when the single command “get (system info)” takes 5-6 seconds.