Well, I don't want to be unfair to Sampling Profilers, so I have added a
checkbox to make the AppServer demo run in single-threaded mode, set the
sampling rate to 10.000 samples per second, set Profiler to start sampling
10 seconds after app has started and to sample for 300 seconds (having the
"Ignore TApplication.Idle OS Time" option enabled).
I've started the AppClient and set it to use 300 connections and flood the
AppServer, using automatic encryption and compression. Then, I have started
the AppServer, made it single-threaded with automatic enctryption and
compression and clicked "Listen" ... and so my testcase was running. A few
seconds later, Sampling Profiler statred measuring times, so there was no
time measured while I was preparing the test case.
After 300 seconds and 289K of sampling data collected, Profiler completed
the job. Since the test was running for 300 seconds with 10.000 samples per
second, it should have collected 10 times as much data (3.000K). The ammound
of data collected should be enough for about 1ms accuracy (1.000 per
second), which is pretty low, since that is one "tick" for each 1.000.000-th
CPU cycle on a 1 GHz PC.
And here are the result after this test ...
Modules (% global time)
---------------------------------------------
40,56% ntdll.dll =>called from
- 8,12% System.TryHarder
- 6,85% rtcHttpSrv.TRtcHttpServer.Flush
- 5,33% WSocket_rtc.TCustomWSocket.DoRecv
- 4,23% WSocket_rtc.TCustomWSocket.RealSend
- 2,52% Controls.FindVCLWindow
- 2,35% Forms.TApplication.ProcessMessages
- 2,31% System.SysGetMem
- 1,87% System.SysFreeMem
- 1,76% System.Decommit
- 1,12% Controls.FindControl
- 0,75% WSocket_rtc.TCustomWSocket.WMASyncSelect
- 0,42% Classes.TStringList.CompareStrings
- 0,39% Controls.AlignWork
- 0,31% rtcSyncObjs.TRtcCritSec.Enter
- 0,28% SysUtils.Now (I'm not calling this one)
- 0,26% WSocket_rtc.TCustomWSocket.SendStr
- 0,19% Clases.ResetSyncEvent
- 0,19% rtcInfo.TRtcFunctionInfo.Destroy
- 0,18% Forms.TApplication.DoActionIdle
- 0,18% WSocket_rtc.TCustomWSocket.TryToSend
- 0,18% System.Commit
- 0,17% Forms.TApplication.DoMouseIdle
- 0,14% rtcSyncObjs.TRtcCritSec.Leave
53,37% AppServer.exe
- 33,09% System
- 2,91% SysUtils
- 2,69% rtcInfo
- 1,78% Classes
- 1,65% rtcZlib
- 1,12% memStrObjList
- 1,03% Forms
All procedures (% global time)
-----------------------------------------
7,07% @FillChar
2,87% FillBeforeGap
2,54% SysGetMem
2,36% SysFreeMem
2,29% @LStrArrayChr
2,15% Move
1,27% FreeCurAlloc
1,25% TryHarder
--------------------------------------------
System unit calls (% glogbal time)
-----------------------------------------------------------
6,98% rtcZlib._memset
=>FillChar(p^, count,b);
3,53% System.MergeCommit
2,14% System.@FreeMem
1,70% System.@GetMem
1,68% System.SysGetMem
1,45% System.@LStrFromPCharLen
--------------------------------------------------------
At least, now I have got 1 point showing me a line in the Compression unit,
with 6,98% ticks. With 7.500 ticks caught by the profiler for more than
60.000 requests procesed, while every request calls this routine at least
once, it is just statistical chance it found one possible source of a
performance drain.
--
Danijel Tkalcec
www.deltasoft.hr/rtc/author.htm
RealThinClient components
-------------------------------------------
* The Easiest way to build Internet-enabled applications
- Clients, Stand-alone Servers, ISAPI extensions -
Quote
Write and Call Remote Functions
Download and Upload Files
Single- and Multi-Threaded mode
Firewall friendly - all over HTTP
Stress-tested for highest stability
www.realthinclient.com
or
www.deltasoft.hr/rtc