Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
[python/dscho.git] / Tools / pybench / Numbers.py
blob10c8940a2101e35807c2280c4250a84fee68ebda
1 from pybench import Test
3 class CompareIntegers(Test):
5 version = 2.0
6 operations = 30 * 5
7 rounds = 120000
9 def test(self):
11 for i in xrange(self.rounds):
13 2 < 3
14 2 > 3
15 2 == 3
16 2 > 3
17 2 < 3
19 2 < 3
20 2 > 3
21 2 == 3
22 2 > 3
23 2 < 3
25 2 < 3
26 2 > 3
27 2 == 3
28 2 > 3
29 2 < 3
31 2 < 3
32 2 > 3
33 2 == 3
34 2 > 3
35 2 < 3
37 2 < 3
38 2 > 3
39 2 == 3
40 2 > 3
41 2 < 3
43 2 < 3
44 2 > 3
45 2 == 3
46 2 > 3
47 2 < 3
49 2 < 3
50 2 > 3
51 2 == 3
52 2 > 3
53 2 < 3
55 2 < 3
56 2 > 3
57 2 == 3
58 2 > 3
59 2 < 3
61 2 < 3
62 2 > 3
63 2 == 3
64 2 > 3
65 2 < 3
67 2 < 3
68 2 > 3
69 2 == 3
70 2 > 3
71 2 < 3
73 2 < 3
74 2 > 3
75 2 == 3
76 2 > 3
77 2 < 3
79 2 < 3
80 2 > 3
81 2 == 3
82 2 > 3
83 2 < 3
85 2 < 3
86 2 > 3
87 2 == 3
88 2 > 3
89 2 < 3
91 2 < 3
92 2 > 3
93 2 == 3
94 2 > 3
95 2 < 3
97 2 < 3
98 2 > 3
99 2 == 3
100 2 > 3
101 2 < 3
103 2 < 3
104 2 > 3
105 2 == 3
106 2 > 3
107 2 < 3
109 2 < 3
110 2 > 3
111 2 == 3
112 2 > 3
113 2 < 3
115 2 < 3
116 2 > 3
117 2 == 3
118 2 > 3
119 2 < 3
121 2 < 3
122 2 > 3
123 2 == 3
124 2 > 3
125 2 < 3
127 2 < 3
128 2 > 3
129 2 == 3
130 2 > 3
131 2 < 3
133 2 < 3
134 2 > 3
135 2 == 3
136 2 > 3
137 2 < 3
139 2 < 3
140 2 > 3
141 2 == 3
142 2 > 3
143 2 < 3
145 2 < 3
146 2 > 3
147 2 == 3
148 2 > 3
149 2 < 3
151 2 < 3
152 2 > 3
153 2 == 3
154 2 > 3
155 2 < 3
157 2 < 3
158 2 > 3
159 2 == 3
160 2 > 3
161 2 < 3
163 2 < 3
164 2 > 3
165 2 == 3
166 2 > 3
167 2 < 3
169 2 < 3
170 2 > 3
171 2 == 3
172 2 > 3
173 2 < 3
175 2 < 3
176 2 > 3
177 2 == 3
178 2 > 3
179 2 < 3
181 2 < 3
182 2 > 3
183 2 == 3
184 2 > 3
185 2 < 3
187 2 < 3
188 2 > 3
189 2 == 3
190 2 > 3
191 2 < 3
193 def calibrate(self):
195 for i in xrange(self.rounds):
196 pass
199 class CompareFloats(Test):
201 version = 2.0
202 operations = 30 * 5
203 rounds = 80000
205 def test(self):
207 for i in xrange(self.rounds):
209 2.1 < 3.31
210 2.1 > 3.31
211 2.1 == 3.31
212 2.1 > 3.31
213 2.1 < 3.31
215 2.1 < 3.31
216 2.1 > 3.31
217 2.1 == 3.31
218 2.1 > 3.31
219 2.1 < 3.31
221 2.1 < 3.31
222 2.1 > 3.31
223 2.1 == 3.31
224 2.1 > 3.31
225 2.1 < 3.31
227 2.1 < 3.31
228 2.1 > 3.31
229 2.1 == 3.31
230 2.1 > 3.31
231 2.1 < 3.31
233 2.1 < 3.31
234 2.1 > 3.31
235 2.1 == 3.31
236 2.1 > 3.31
237 2.1 < 3.31
239 2.1 < 3.31
240 2.1 > 3.31
241 2.1 == 3.31
242 2.1 > 3.31
243 2.1 < 3.31
245 2.1 < 3.31
246 2.1 > 3.31
247 2.1 == 3.31
248 2.1 > 3.31
249 2.1 < 3.31
251 2.1 < 3.31
252 2.1 > 3.31
253 2.1 == 3.31
254 2.1 > 3.31
255 2.1 < 3.31
257 2.1 < 3.31
258 2.1 > 3.31
259 2.1 == 3.31
260 2.1 > 3.31
261 2.1 < 3.31
263 2.1 < 3.31
264 2.1 > 3.31
265 2.1 == 3.31
266 2.1 > 3.31
267 2.1 < 3.31
269 2.1 < 3.31
270 2.1 > 3.31
271 2.1 == 3.31
272 2.1 > 3.31
273 2.1 < 3.31
275 2.1 < 3.31
276 2.1 > 3.31
277 2.1 == 3.31
278 2.1 > 3.31
279 2.1 < 3.31
281 2.1 < 3.31
282 2.1 > 3.31
283 2.1 == 3.31
284 2.1 > 3.31
285 2.1 < 3.31
287 2.1 < 3.31
288 2.1 > 3.31
289 2.1 == 3.31
290 2.1 > 3.31
291 2.1 < 3.31
293 2.1 < 3.31
294 2.1 > 3.31
295 2.1 == 3.31
296 2.1 > 3.31
297 2.1 < 3.31
299 2.1 < 3.31
300 2.1 > 3.31
301 2.1 == 3.31
302 2.1 > 3.31
303 2.1 < 3.31
305 2.1 < 3.31
306 2.1 > 3.31
307 2.1 == 3.31
308 2.1 > 3.31
309 2.1 < 3.31
311 2.1 < 3.31
312 2.1 > 3.31
313 2.1 == 3.31
314 2.1 > 3.31
315 2.1 < 3.31
317 2.1 < 3.31
318 2.1 > 3.31
319 2.1 == 3.31
320 2.1 > 3.31
321 2.1 < 3.31
323 2.1 < 3.31
324 2.1 > 3.31
325 2.1 == 3.31
326 2.1 > 3.31
327 2.1 < 3.31
329 2.1 < 3.31
330 2.1 > 3.31
331 2.1 == 3.31
332 2.1 > 3.31
333 2.1 < 3.31
335 2.1 < 3.31
336 2.1 > 3.31
337 2.1 == 3.31
338 2.1 > 3.31
339 2.1 < 3.31
341 2.1 < 3.31
342 2.1 > 3.31
343 2.1 == 3.31
344 2.1 > 3.31
345 2.1 < 3.31
347 2.1 < 3.31
348 2.1 > 3.31
349 2.1 == 3.31
350 2.1 > 3.31
351 2.1 < 3.31
353 2.1 < 3.31
354 2.1 > 3.31
355 2.1 == 3.31
356 2.1 > 3.31
357 2.1 < 3.31
359 2.1 < 3.31
360 2.1 > 3.31
361 2.1 == 3.31
362 2.1 > 3.31
363 2.1 < 3.31
365 2.1 < 3.31
366 2.1 > 3.31
367 2.1 == 3.31
368 2.1 > 3.31
369 2.1 < 3.31
371 2.1 < 3.31
372 2.1 > 3.31
373 2.1 == 3.31
374 2.1 > 3.31
375 2.1 < 3.31
377 2.1 < 3.31
378 2.1 > 3.31
379 2.1 == 3.31
380 2.1 > 3.31
381 2.1 < 3.31
383 2.1 < 3.31
384 2.1 > 3.31
385 2.1 == 3.31
386 2.1 > 3.31
387 2.1 < 3.31
389 def calibrate(self):
391 for i in xrange(self.rounds):
392 pass
395 class CompareFloatsIntegers(Test):
397 version = 2.0
398 operations = 30 * 5
399 rounds = 60000
401 def test(self):
403 for i in xrange(self.rounds):
405 2.1 < 4
406 2.1 > 4
407 2.1 == 4
408 2.1 > 4
409 2.1 < 4
411 2.1 < 4
412 2.1 > 4
413 2.1 == 4
414 2.1 > 4
415 2.1 < 4
417 2.1 < 4
418 2.1 > 4
419 2.1 == 4
420 2.1 > 4
421 2.1 < 4
423 2.1 < 4
424 2.1 > 4
425 2.1 == 4
426 2.1 > 4
427 2.1 < 4
429 2.1 < 4
430 2.1 > 4
431 2.1 == 4
432 2.1 > 4
433 2.1 < 4
435 2.1 < 4
436 2.1 > 4
437 2.1 == 4
438 2.1 > 4
439 2.1 < 4
441 2.1 < 4
442 2.1 > 4
443 2.1 == 4
444 2.1 > 4
445 2.1 < 4
447 2.1 < 4
448 2.1 > 4
449 2.1 == 4
450 2.1 > 4
451 2.1 < 4
453 2.1 < 4
454 2.1 > 4
455 2.1 == 4
456 2.1 > 4
457 2.1 < 4
459 2.1 < 4
460 2.1 > 4
461 2.1 == 4
462 2.1 > 4
463 2.1 < 4
465 2.1 < 4
466 2.1 > 4
467 2.1 == 4
468 2.1 > 4
469 2.1 < 4
471 2.1 < 4
472 2.1 > 4
473 2.1 == 4
474 2.1 > 4
475 2.1 < 4
477 2.1 < 4
478 2.1 > 4
479 2.1 == 4
480 2.1 > 4
481 2.1 < 4
483 2.1 < 4
484 2.1 > 4
485 2.1 == 4
486 2.1 > 4
487 2.1 < 4
489 2.1 < 4
490 2.1 > 4
491 2.1 == 4
492 2.1 > 4
493 2.1 < 4
495 2.1 < 4
496 2.1 > 4
497 2.1 == 4
498 2.1 > 4
499 2.1 < 4
501 2.1 < 4
502 2.1 > 4
503 2.1 == 4
504 2.1 > 4
505 2.1 < 4
507 2.1 < 4
508 2.1 > 4
509 2.1 == 4
510 2.1 > 4
511 2.1 < 4
513 2.1 < 4
514 2.1 > 4
515 2.1 == 4
516 2.1 > 4
517 2.1 < 4
519 2.1 < 4
520 2.1 > 4
521 2.1 == 4
522 2.1 > 4
523 2.1 < 4
525 2.1 < 4
526 2.1 > 4
527 2.1 == 4
528 2.1 > 4
529 2.1 < 4
531 2.1 < 4
532 2.1 > 4
533 2.1 == 4
534 2.1 > 4
535 2.1 < 4
537 2.1 < 4
538 2.1 > 4
539 2.1 == 4
540 2.1 > 4
541 2.1 < 4
543 2.1 < 4
544 2.1 > 4
545 2.1 == 4
546 2.1 > 4
547 2.1 < 4
549 2.1 < 4
550 2.1 > 4
551 2.1 == 4
552 2.1 > 4
553 2.1 < 4
555 2.1 < 4
556 2.1 > 4
557 2.1 == 4
558 2.1 > 4
559 2.1 < 4
561 2.1 < 4
562 2.1 > 4
563 2.1 == 4
564 2.1 > 4
565 2.1 < 4
567 2.1 < 4
568 2.1 > 4
569 2.1 == 4
570 2.1 > 4
571 2.1 < 4
573 2.1 < 4
574 2.1 > 4
575 2.1 == 4
576 2.1 > 4
577 2.1 < 4
579 2.1 < 4
580 2.1 > 4
581 2.1 == 4
582 2.1 > 4
583 2.1 < 4
585 def calibrate(self):
587 for i in xrange(self.rounds):
588 pass
591 class CompareLongs(Test):
593 version = 2.0
594 operations = 30 * 5
595 rounds = 70000
597 def test(self):
599 for i in xrange(self.rounds):
601 1234567890L < 3456789012345L
602 1234567890L > 3456789012345L
603 1234567890L == 3456789012345L
604 1234567890L > 3456789012345L
605 1234567890L < 3456789012345L
607 1234567890L < 3456789012345L
608 1234567890L > 3456789012345L
609 1234567890L == 3456789012345L
610 1234567890L > 3456789012345L
611 1234567890L < 3456789012345L
613 1234567890L < 3456789012345L
614 1234567890L > 3456789012345L
615 1234567890L == 3456789012345L
616 1234567890L > 3456789012345L
617 1234567890L < 3456789012345L
619 1234567890L < 3456789012345L
620 1234567890L > 3456789012345L
621 1234567890L == 3456789012345L
622 1234567890L > 3456789012345L
623 1234567890L < 3456789012345L
625 1234567890L < 3456789012345L
626 1234567890L > 3456789012345L
627 1234567890L == 3456789012345L
628 1234567890L > 3456789012345L
629 1234567890L < 3456789012345L
631 1234567890L < 3456789012345L
632 1234567890L > 3456789012345L
633 1234567890L == 3456789012345L
634 1234567890L > 3456789012345L
635 1234567890L < 3456789012345L
637 1234567890L < 3456789012345L
638 1234567890L > 3456789012345L
639 1234567890L == 3456789012345L
640 1234567890L > 3456789012345L
641 1234567890L < 3456789012345L
643 1234567890L < 3456789012345L
644 1234567890L > 3456789012345L
645 1234567890L == 3456789012345L
646 1234567890L > 3456789012345L
647 1234567890L < 3456789012345L
649 1234567890L < 3456789012345L
650 1234567890L > 3456789012345L
651 1234567890L == 3456789012345L
652 1234567890L > 3456789012345L
653 1234567890L < 3456789012345L
655 1234567890L < 3456789012345L
656 1234567890L > 3456789012345L
657 1234567890L == 3456789012345L
658 1234567890L > 3456789012345L
659 1234567890L < 3456789012345L
661 1234567890L < 3456789012345L
662 1234567890L > 3456789012345L
663 1234567890L == 3456789012345L
664 1234567890L > 3456789012345L
665 1234567890L < 3456789012345L
667 1234567890L < 3456789012345L
668 1234567890L > 3456789012345L
669 1234567890L == 3456789012345L
670 1234567890L > 3456789012345L
671 1234567890L < 3456789012345L
673 1234567890L < 3456789012345L
674 1234567890L > 3456789012345L
675 1234567890L == 3456789012345L
676 1234567890L > 3456789012345L
677 1234567890L < 3456789012345L
679 1234567890L < 3456789012345L
680 1234567890L > 3456789012345L
681 1234567890L == 3456789012345L
682 1234567890L > 3456789012345L
683 1234567890L < 3456789012345L
685 1234567890L < 3456789012345L
686 1234567890L > 3456789012345L
687 1234567890L == 3456789012345L
688 1234567890L > 3456789012345L
689 1234567890L < 3456789012345L
691 1234567890L < 3456789012345L
692 1234567890L > 3456789012345L
693 1234567890L == 3456789012345L
694 1234567890L > 3456789012345L
695 1234567890L < 3456789012345L
697 1234567890L < 3456789012345L
698 1234567890L > 3456789012345L
699 1234567890L == 3456789012345L
700 1234567890L > 3456789012345L
701 1234567890L < 3456789012345L
703 1234567890L < 3456789012345L
704 1234567890L > 3456789012345L
705 1234567890L == 3456789012345L
706 1234567890L > 3456789012345L
707 1234567890L < 3456789012345L
709 1234567890L < 3456789012345L
710 1234567890L > 3456789012345L
711 1234567890L == 3456789012345L
712 1234567890L > 3456789012345L
713 1234567890L < 3456789012345L
715 1234567890L < 3456789012345L
716 1234567890L > 3456789012345L
717 1234567890L == 3456789012345L
718 1234567890L > 3456789012345L
719 1234567890L < 3456789012345L
721 1234567890L < 3456789012345L
722 1234567890L > 3456789012345L
723 1234567890L == 3456789012345L
724 1234567890L > 3456789012345L
725 1234567890L < 3456789012345L
727 1234567890L < 3456789012345L
728 1234567890L > 3456789012345L
729 1234567890L == 3456789012345L
730 1234567890L > 3456789012345L
731 1234567890L < 3456789012345L
733 1234567890L < 3456789012345L
734 1234567890L > 3456789012345L
735 1234567890L == 3456789012345L
736 1234567890L > 3456789012345L
737 1234567890L < 3456789012345L
739 1234567890L < 3456789012345L
740 1234567890L > 3456789012345L
741 1234567890L == 3456789012345L
742 1234567890L > 3456789012345L
743 1234567890L < 3456789012345L
745 1234567890L < 3456789012345L
746 1234567890L > 3456789012345L
747 1234567890L == 3456789012345L
748 1234567890L > 3456789012345L
749 1234567890L < 3456789012345L
751 1234567890L < 3456789012345L
752 1234567890L > 3456789012345L
753 1234567890L == 3456789012345L
754 1234567890L > 3456789012345L
755 1234567890L < 3456789012345L
757 1234567890L < 3456789012345L
758 1234567890L > 3456789012345L
759 1234567890L == 3456789012345L
760 1234567890L > 3456789012345L
761 1234567890L < 3456789012345L
763 1234567890L < 3456789012345L
764 1234567890L > 3456789012345L
765 1234567890L == 3456789012345L
766 1234567890L > 3456789012345L
767 1234567890L < 3456789012345L
769 1234567890L < 3456789012345L
770 1234567890L > 3456789012345L
771 1234567890L == 3456789012345L
772 1234567890L > 3456789012345L
773 1234567890L < 3456789012345L
775 1234567890L < 3456789012345L
776 1234567890L > 3456789012345L
777 1234567890L == 3456789012345L
778 1234567890L > 3456789012345L
779 1234567890L < 3456789012345L
781 def calibrate(self):
783 for i in xrange(self.rounds):
784 pass