This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: UTF-8 | |
| """ Telco Benchmark for measuring the performance of decimal calculations | |
| http://www2.hursley.ibm.com/decimal/telco.html | |
| http://www2.hursley.ibm.com/decimal/telcoSpec.html | |
| A call type indicator, c, is set from the bottom (least significant) bit of the duration (hence c is 0 or 1). | |
| A r, r, is determined from the call type. Those calls with c=0 have a low r: 0.0013; the remainder (‘distance calls’) have a ‘premium’ r: 0.00894. (The rates are, very roughly, in Euros or dollarates per second.) | |
| A price, p, for the call is then calculated (p=r*n). This is rounded to exactly 2 fractional digits using round-half-even (Banker’s round to nearest). | |
| A basic tax, b, is calculated: b=p*0.0675 (6.75%). This is truncated to exactly 2 fractional digits (round-down), and the total basic tax variable is then incremented (sumB=sumB+b). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import pandas as pd | |
| import numpy as np | |
| from plotmem import Plotmem | |
| import gc | |
| def leak1(): | |
| for i in Plotmem(100): | |
| df = pd.DataFrame( | |
| {'A': ['foo', 'bar'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <algorithm> | |
| #include <ctime> | |
| #include <iostream> | |
| int main(int argc, char** argv) | |
| { | |
| // Generate data | |
| const unsigned arraySize = 32768; | |
| int data[arraySize]; |
NewerOlder