관리-도구
편집 파일: pystone.cpython-311.pyc
� �܋f � �* � d Z ddlmZ ddlmZ dZdZ edd� � \ ZZ Z ZZ G d� d e � � ZdZdZefd �Zefd�Zdaeadadadgd z ad� t. gd z D � � adadaefd�Zd� Zd� Zd� Zd� Zd� Z d� Z!d� Z"d� Z#d� Z$d� Z%d� Z&e'dk rddl(Z(d� Z) e*e(j+ � � dz Z,e,dk r e)de,z � � nCe,dk r; e-e(j+ d � � Z.n&# e/$ r e)de(j+ d z � � Y nw xY weZ. ee.� � dS dS ) a� "PYSTONE" Benchmark Program Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes) Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013. Translated from ADA to C by Rick Richardson. Every method to preserve ADA-likeness has been used, at the expense of C-ness. Translated from C to Python by Guido van Rossum. Version History: Version 1.1 corrects two bugs in version 1.0: First, it leaked memory: in Proc1(), NextRecord ends up having a pointer to itself. I have corrected this by zapping NextRecord.PtrComp at the end of Proc1(). Second, Proc3() used the operator != to compare a record to None. This is rather inefficient and not true to the intention of the original benchmark (where a pointer comparison to None is intended; the != operator attempts to find a method __cmp__ to do value comparison of the record). Version 1.1 runs 5-10 percent faster than version 1.0, so benchmark figures of different versions can't be compared directly. � )�print_function)�clockiP� z1.1� � c � � e Zd Z dd�Zd� ZdS )�RecordNr c �L � || _ || _ || _ || _ || _ d S �N)�PtrComp�Discr�EnumComp�IntComp� StringComp)�selfr r r r r s �n/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/future/backports/test/pystone.py�__init__zRecord.__init__/ s) � ������ � �� ����$����� c �Z � t | j | j | j | j | j � � S r )r r r r r r )r s r �copyzRecord.copy7 s) � ��d�l�D�J�� ��l�D�O�5� 5� 5r )Nr r r r )�__name__� __module__�__qualname__r r � r r r r - s= � � � � � �=>�12�%� %� %� %�5� 5� 5� 5� 5r r c � � t | � � \ }}t dt | |fz � � t d|z � � d S )Nz#Pystone(%s) time for %d passes = %gz-This machine benchmarks at %g pystones/second)�pystones�print�__version__)�loops� benchtime�stoness r �mainr! >