Simple Performance Analysis

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Simple Performance Analysis

Postby jkoepp » Thu Dec 04, 2008 5:23 am

The common tool for profiling / performance optimization / bottleneck detection is the Benchmark Workshop which can be loaded for instance by the ConfigMap "ENVY/Stats ES-ALL" or the EsbAnalysisTools Application. Then you have to write a kind of test-method which will be executed and gives measurements and a graphical comparison of the results.

TestCase>>#sampleAnalysisFor: of SUnitBrowser gave the idea to write the following small utility method for the Class Block:

Code: Select all
Block>>#benchmarkAndBrowse

benchmarkAndBrowse

   | sampler |

   sampler := EsbSampler spyOn: self.
   sampler browse


Now we can at every place in the code, in the debugger or after having started any kind of big application make a performance analysis of a piece of code by executing simply [...] benchmarkAndBrowse without the need to start Benchmark Workshop and to write a test. Only put your code in the block or put some brackets around your code and send benchmarkAndBrowse!

For small code pieces I use
EsbTimer microsecondsToRun: [...]

Juergen
jkoepp
 
Posts: 9
Joined: Mon Mar 31, 2008 4:40 am

Re: Simple Performance Analysis

Postby McAllister » Thu Dec 04, 2008 7:18 am

I try it and it's very nice! :D

Thank you very much!
McAllister
McAllister
 
Posts: 5
Joined: Thu May 15, 2008 12:04 am
Location: Germany

Re: Simple Performance Analysis

Postby wembley » Wed Jan 07, 2009 1:25 pm

Juergen -

This looks like a useful little addition to ENVY/Stats. With your permission, I will include it in VA Smalltalk V8.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: Simple Performance Analysis

Postby wembley » Thu Jan 08, 2009 5:10 am

Case 38594 opened -- fixed in V8.0.0.

I will extend Juergen's idea a bit and add two methods to Block (instead of one) -- sampleAndBrowse and traceAndBrowse.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest