Issue 473 in tradelink: profile ExecutionPerformance unit test

0 views
Skip to first unread message

trad...@googlecode.com

unread,
Dec 19, 2009, 4:42:28 AM12/19/09
to tradelink-...@googlegroups.com
Status: Accepted
Owner: frantajosh

New issue 473 by frantajosh: profile ExecutionPerformance unit test
http://code.google.com/p/tradelink/issues/detail?id=473


to see why executions are slower than rest of the simulation.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

trad...@googlecode.com

unread,
Jan 8, 2010, 11:33:20 PM1/8/10
to tradelink-...@googlegroups.com

Comment #1 on issue 473 by frantajosh: profile ExecutionPerformance unit
test
http://code.google.com/p/tradelink/issues/detail?id=473

here is my test, which I'm profiling using EQATEC free .net profiler

class Program
{
static int tickcount = 0;
static long lasttime = 0;
const double EXPECTEX = .8;
static HistSim h;
static void Main(string[] args)
{
h = new
HistSim(@"C:\Users\jfranta\Desktop\TLS\TradeLinkTests\");
h.GotTick += new TradeLink.API.TickDelegate(execute_GotTick);
h.SimBroker.GotFill += new
TradeLink.API.FillDelegate(SimBroker_GotFill);

for (int i = 0; i < 1000; i++)
GO();
}

static void GO()
{
h.Reset();
h.Initialize();
System.Threading.Thread.Sleep(1000);
tickcount = 0;
lasttime = 0;
fillcount = 0;

DateTime start = DateTime.Now;
h.PlayTo(HistSim.ENDSIM);
double time = DateTime.Now.Subtract(start).TotalSeconds;
Console.WriteLine("Execution runtime: " + time.ToString("N2")
+ "sec,
versus: " + EXPECTEX + "sec expected.");
Console.WriteLine("Execution " + ((double)tickcount /
time).ToString("N0") + " ticks/sec. " + ((double)fillcount /
time).ToString("N0") +
" fills/sec");
h.Stop();

}
const double EXPECT2SYMTIME = 1.5;
const int desiredfills = 1000;
static int fillcount = 0;
static List<string> syms = new List<string>();

static void SimBroker_GotFill(TradeLink.API.Trade t)
{
fillcount++;
}

static void execute_GotTick(TradeLink.API.Tick t)
{
tickcount++;
// generate fills periodically
if (fillcount >= desiredfills) return;
if (tickcount % 50 == 0)
{
bool side = fillcount % 2 == 0;
h.SimBroker.sendOrder(new MarketOrder(t.symbol, side, 100));

trad...@googlecode.com

unread,
Jan 9, 2010, 12:41:45 AM1/9/10
to tradelink-...@googlegroups.com

Comment #2 on issue 473 by frantajosh: profile ExecutionPerformance unit
test
http://code.google.com/p/tradelink/issues/detail?id=473

(No comment was entered for this change.)

Attachments:
TL473.jpg 48.0 KB

trad...@googlecode.com

unread,
Jan 9, 2010, 4:45:42 AM1/9/10
to tradelink-...@googlegroups.com
Updates:
Status: Verified

Comment #3 on issue 473 by frantajosh: profile ExecutionPerformance unit
test
http://code.google.com/p/tradelink/issues/detail?id=473

reworked account.Equals call to use faster comparison here :

http://blogs.msdn.com/noahc/archive/2007/06/29/string-equals-performance-
comparison.aspx

got around 20% increase. rest of increase will need to come from
refactoring the
process.

Reply all
Reply to author
Forward
0 new messages