<commit_before>import time

def initTrades(trades):
    for i, trade in enumerate(trades):
        if i % 2:
            aside = 'S'
        else:
            aside = 'B'
        trade["tradeId"] = i
        trade["clientId"] = 1
        trade["venueId"] = 123
        trade["instrumentCode"] = 321
        trade["price"] = i
        trade["quantity"] = i
        trade["side"] = aside

def perfRun(runNum, trades):
    start = time.time() * 1000
    initTrades(trades)
    buyCost, sellCost = 0, 0
    for trade in trades:
        if trade["side"] == 'B':
            buyCost += trade["price"] * trade["quantity"]
        else:
            sellCost += trade["price"] * trade["quantity"]
    print (runNum, "- duration" , ((time.time() * 1000) - start), "ms")
    print ("buyCost = ", buyCost, " sellCost = ", sellCost)

if __name__ == '__main__':
    NUM_RECORDS = 50 * 1000 * 10
    PyMemTrade = {"tradeId": 0, "clientId": 0, "venueId": 0, 
                  "instrumentCode": 0, "price": 0, "quantity": 0, "side": "0"}
    trades = [PyMemTrade.copy() for i in range(NUM_RECORDS)]
    for i in range (0, 5):
        perfRun(i, trades)<commit_msg>Fixed printing.<commit_after>import time

def initTrades(trades):
    for i, trade in enumerate(trades):
        if i % 2:
            aside = 'S'
        else:
            aside = 'B'
        trade["tradeId"] = i
        trade["clientId"] = 1
        trade["venueId"] = 123
        trade["instrumentCode"] = 321
        trade["price"] = i
        trade["quantity"] = i
        trade["side"] = aside

def perfRun(runNum, trades):
    start = time.time() * 1000
    initTrades(trades)
    buyCost, sellCost = 0, 0
    for trade in trades:
        if trade["side"] == 'B':
            buyCost += trade["price"] * trade["quantity"]
        else:
            sellCost += trade["price"] * trade["quantity"]
    print (runNum, "- duration" , int((time.time() * 1000) - start), "ms")
    print ("buyCost = ", buyCost, " sellCost = ", sellCost)

if __name__ == '__main__':
    NUM_RECORDS = 50 * 1000 * 444
    PyMemTrade = {"tradeId": 0, "clientId": 0, "venueId": 0, 
                  "instrumentCode": 0, "price": 0, "quantity": 0, "side": "0"}
    trades = [PyMemTrade.copy() for i in range(NUM_RECORDS)]
    for i in range (0, 5):
        perfRun(i, trades)
{'fraction_non_alphanumeric': 0.16203301476976542, 'fraction_numerical': 0.030842745438748913, 'mean_word_length': 2.2666666666666666, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4571679', 'n_tokens_mistral': 842, 'n_tokens_neox': 745, 'n_words': 208}