Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Peng Yu Newsgroups: gnu.bash.bug Subject: Re: performance bug of [[ $x ]] Date: Sat, 7 Mar 2020 18:33:19 -0600 Lines: 23 Approved: bug-bash@gnu.org Message-ID: References: <20200307225816.GA997327@chrisdown.name> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1583627605 5829 209.51.188.17 (8 Mar 2020 00:33:25 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash To: Chris Down Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cq/MxlPPwycVW7c+qgyp6648isO/m0lhUWeODz6h6J0=; b=JMi4W5bnx3pfWSBpG/lH5/ZPkagxBszs+xsNougYhdMJsRSPcbqi6xhM0VGPUGrPkO JKoLw4wPsDfmwVdLk0mUjb+gwUacnuhSSBPWvMaTaJReFAW5aRYgz5m/IJ/Kn5H/l7Qb /57xZmiliM/0pGOlJUC5us/TccAIrlwZ1SuztRFB34tXPVOiQYeQm+jeSfYlcqXvqCga dcrJZH2WPlg6lqAIQXz3/dGxq7/EzfF2DH/Q7Qt9/rKNt5XmZe9PLRmyGIaVA5VTrL4S JqwemP+UL6kXu8UuaQfq3TeKizZpJm3frs9wVZzoWYjeMfnJGFTHUTBF7pyPee/QAacQ NsBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cq/MxlPPwycVW7c+qgyp6648isO/m0lhUWeODz6h6J0=; b=PW5Vk8kL8uyZfJvV6Vul+XoXVo0oleITqlSjHDiF+YCxHacOFzefevvi1LacQg/J1z O9laaoYkXXZamwjsUl/2l9u6/CvYbE+6KVYZbOQkzD8+0Dr7zN2L1RONw+9bfLOpJjXf c88BsX2d4CV5KQ+4pHoUC8H6bcE7ztcMKAGfsfT37V17XX5oeuaEMjGwj32adGy+191m lqwT1Gx3vSrrOx8zifv7/8mnx+HnhquYWyNBx73GGi9CWsjFtELdrs9u8RdYQkHfN81A UBfVYuODlXmSCxSat2FYNWUzTVpTRMtGdd/IkbQPc/NjDU9PfuIRGoHVmo4tdZBubFAJ HVaw== X-Gm-Message-State: ANhLgQ09QYWRnTLR7/yg9GlnoFmHhtdKK0k/h8qhqbP9Bky5iP7RxwSM SA3U1Sk9gYtmXcMEelE3wWXHdIx19kwC3pcgYXI= X-Google-Smtp-Source: ADFU+vv1hPT96BkJC6AJGjsnapvCKeaImrBBd6IOEUNw02jchF41GSEdcMzovTQsJTDjOv7EzonW0zS/gUR2JWfITQg= X-Received: by 2002:a92:c106:: with SMTP id p6mr9074531ile.95.1583627600201; Sat, 07 Mar 2020 16:33:20 -0800 (PST) In-Reply-To: <20200307225816.GA997327@chrisdown.name> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::12d X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <20200307225816.GA997327@chrisdown.name> Xref: csiph.com gnu.bash.bug:16000 Could you show me how you do the profiling for this specific case? Based on what proof that you can conclude that it is not the `[[` performance problem? On 3/7/20, Chris Down wrote: > Peng Yu writes: >>[[ $x ]] just tests whether the variable $x is of length 0 or not. So >>its performance should not depend on how long the variable is. > > Who said it has anything to do with the [[ builtin's performance? A shell > does > a lot more than just running one command. > > For this and the last issue you posted, you could quite trivially find out > the > answer yourself using `perf` or another profiler. > -- Regards, Peng