From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Elisp native profiler Date: Wed, 03 Oct 2012 19:43:20 +0200 Message-ID: <831uhfa1tz.fsf@gnu.org> References: <83zk4egs0w.fsf@gnu.org> <83y5jygrni.fsf@gnu.org> <50620443.8050301@cs.ucla.edu> <20120926151625.229ef3cc9caf90e5098b18ef@cx4a.org> <20121001014217.03ac31a69b9b43516cb0dd61@cx4a.org> <50689C1D.8080005@cs.ucla.edu> <5068AEE2.4080004@cs.ucla.edu> <5068F696.7040600@cs.ucla.edu> <83txueb63s.fsf@gnu.org> <5069C7C1.7040206@cs.ucla.edu> <83a9w6axlk.fsf@gnu.org> <87pq51c8jg.fsf@gnu.org> <83txucaize.fsf@gnu.org> <87lifnpr8f.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1349286212 8208 80.91.229.3 (3 Oct 2012 17:43:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Oct 2012 17:43:32 +0000 (UTC) Cc: tomo@cx4a.org, eggert@cs.ucla.edu, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 03 19:43:35 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TJSyd-0005so-9c for ged-emacs-devel@m.gmane.org; Wed, 03 Oct 2012 19:43:19 +0200 Original-Received: from localhost ([::1]:39091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJSyX-0001U0-Hz for ged-emacs-devel@m.gmane.org; Wed, 03 Oct 2012 13:43:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJSyV-0001Tu-Dr for emacs-devel@gnu.org; Wed, 03 Oct 2012 13:43:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJSyU-0004e5-6s for emacs-devel@gnu.org; Wed, 03 Oct 2012 13:43:11 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:36526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJSyT-0004e1-Vs; Wed, 03 Oct 2012 13:43:10 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MBB00000VVARN00@a-mtaout22.012.net.il>; Wed, 03 Oct 2012 19:43:08 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MBB000PRVVWI150@a-mtaout22.012.net.il>; Wed, 03 Oct 2012 19:43:08 +0200 (IST) In-reply-to: <87lifnpr8f.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154019 Archived-At: > From: Jason Rumney > Cc: eggert@cs.ucla.edu, tomo@cx4a.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Wed, 03 Oct 2012 22:25:36 +0800 > > Timeslices are probably much shorter now than the 10ms they used to be > in Windows 95, but I guarantee they are still much longer than the time > it takes to execute: > > > while (clock () < expiration_time) > > Sleep (0); > > This is exactly the condition that will cause a false reading on a CPU > monitor, as the thread is runnable in every single timeslice, > even if it is immediately relinquishing it to another thread. The CPU > monitor is only checking on the granularity of a timeslice so it sees > 100%, where the actual usage for this process might be a fraction of 1%. Thanks. There's something to learn every day.