Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Academic Program.NET Performanzanalyse und Optimierung Matej Ciesko Student Technology Conference 2005.

Similar presentations


Presentation on theme: "Microsoft Academic Program.NET Performanzanalyse und Optimierung Matej Ciesko Student Technology Conference 2005."— Presentation transcript:

1 Microsoft Academic Program.NET Performanzanalyse und Optimierung Matej Ciesko Student Technology Conference 2005

2 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 2/23.NET Performanzanalyse und Optimierung Matej Ciesko SSP – Microsoft Academic Program Microsoft Deutschland GmbH

3 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 3/23 Moores Law Anzahl der Transistoren verdoppelt sich alle 18 Monate Intel Corp.

4 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 4/23 Agenda Microsoft.NET Framework Common Language Runtime Base Classes Web ServicesUser Interface Data and XML ADO.NETXML... Operating System Hardware

5 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 5/23 Ziele WAS ? WO ? WIE ?

6 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 6/23 Definitionen Performanz: Performanz (aus engl. Performance) bezeichnet in der Informatik die Effizienz von Programmen und Hardware bezüglich des Ressourcenverbrauchs und der Qualität der Ausgabe. [Wikipedia] Optimierung: Optimizing is the process of changing a program or the environment in which it runs to improve its performance. 1.Problem identifizieren. 2.Problem evaluieren. 3.Optimierungstechnik anwenden.

7 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 7/23 Hardware Speicher Branch Predictions Nebenläufigkeit Itanium2 McKinley

8 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 8/23 2. Profiling Profiling: Präzise Messung (von Zeit/ Clock Ticks) von Hardware und/Software um Aussagen über das Laufzeitverhalten von Applikation treffen zu können. 1.Hardwarezähler 2.Windows API and Tools 3..NET Profiling und Tools 4.Demos

9 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 9/23 Hardware Counters I Hardware Counters + Sehr hohe zeitliche Auflösung CPU Profiling Hardware –Ereignisdetektoren (event detectors) –Ereigniszähler (event counters) Performanzereignisse : –Speicher –Pipeline Stalls –Brach Prediction –Ressource Utilization

10 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 10/23 Hardware Counters II RDTSC – Read Time Stamp Counter RDPMC – Read Performance Monitor Counter >2 x CPU SpeedStep Beispiel: RDTSC(Read Time Step Counter) __int64 getTick(){ __int64 tmp; void *_ptr = &tmp; _asm{ rdtsc; mov ebx, _ptr; mov dword ptr[ebx], eax; mov dword ptr[ebx+4], edx; } return tmp; }

11 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 11/23 Windows Performance API Access performance counters through Windows API WMI - Windows Management Instrumentation BOOL QueryPerformanceCounter( LARGE_INTEGER *lpPerformanceCount ); BOOL QueryPerformanceFrequency( LARGE_INTEGER *lpPerformanceCount ); DWORD_PTR SetThreadAffinityMask( HANDLE hThread, DWORD_PTR dwThreadAffinityMask );

12 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 12/23.NET Profiling Perfmon WMI MS.NET 1.1 [DllImport("Kernel32.dll")] private static extern bool QueryPerformanceCounter(out long _count); MS.NET 2.0 using System.Diagnostics; … Stopwatch _sw = new Stopwatch(); _sw.Start(); do something _sw.Stop(); _sw.ElapsedTime; // TimeSpan _sw.ElapsedMilliseconds; //long _ws.ElapsedTicks; //long

13 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 13/23.NET Profiling Services set Cor_Enable_Profiling = 0x1 set Cor_Profiler={FA0C6E77-AFF4-…992C} COM – Schnittstellen: ICorProfilerCallback ICorProfilerInfo CLR _myProfiler Cor_Enable_Profiling = TRUE CoCreateInstance ICorProfilerCallback::Initialize Demo AP

14 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 14/23.NET 1.1. vs.NET 2.0 SciMark (SOR), Monte-Carlo Quadrat, Sparse Matrix Multiplikation, LU Matrix Dekomposition MFLOP HW: 3.2 GHz Pentium 4 (Northwood), 1x CPU, HT disabled Intel 875P Chipset, 1 GB RAM

15 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 15/23.NET 1.1. vs.NET 2.0 Linpack 1000x MFLOP HW: 3.2 GHz Pentium 4 (Northwood), 1x CPU, HT disabled Intel 875P Chipset, 1 GB RAM Mono NET 1.1 Debug

16 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 16/23 C# vs. C HW: 2.4GHz Pentium 4, 1 GB RAM

17 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 17/23 Rotor Microsoft Shared Source CLI - Rotor ECMA-334 (C#) ECMA-335 (Common Language Infrastructure) Microsoft Windows® XP FreeBSD SSCLI:

18 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 18/23 Zusammenfassung Performance Engineering 1. Messen: Sind Performanzanforderungen erfüllt? JA 2. NEIN: Finde langsamen Code Eigener Code? – Optimieren. Framework Methode? – Weglassen, Alternative suchen. Nicht ersetzbarer Aufruf? – Optimieren, Alternative suchen.

19 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 19/23 © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

20 Microsoft Academic Program Student Technology Conference /05/05 MS.NET – Performanzanalyse und Optimierung Matej Ciesko 20/23 Mehr Informationen RDTSC:


Download ppt "Microsoft Academic Program.NET Performanzanalyse und Optimierung Matej Ciesko Student Technology Conference 2005."

Similar presentations


Ads by Google