Skip to content

Instantly share code, notes, and snippets.

@mnem mnem/gist:333822
Created Mar 16, 2010

Embed
What would you like to do?
public function speedTestA() :void
{
var a :int = 1;
var b :int = 2;
b = a + a + a;
}
public function speedTestB() :void
{
var a :int = 1;
var b :int = 2;
b = a + a;
b += a;
}
// Bytecode for the above functions:
//
// function performancetests:Test:::speedTestA()::void
// maxStack:2 localCount:3 initScopeDepth:4 maxScopeDepth:5
// getlocal0
// pushscope
// pushbyte 1
// setlocal1
// pushbyte 2
// setlocal2
// getlocal1
// getlocal1
// add
// getlocal1
// add
// convert_i
// setlocal2
// returnvoid
// 0 Extras
// 0 Traits Entries
//
// function performancetests:Test:::speedTestB()::void
// maxStack:2 localCount:3 initScopeDepth:4 maxScopeDepth:5
// getlocal0
// pushscope
// pushbyte 1
// setlocal1
// pushbyte 2
// setlocal2
// getlocal1
// getlocal1
// add
// convert_i
// setlocal2
// getlocal2
// getlocal1
// add
// convert_i
// setlocal2
// returnvoid
// 0 Extras
// 0 Traits Entries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.