a
    �Ï?eX  ã                   @   sÚ   d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	 ddddd	id
œZ
eƒ Zeƒ Zeƒ Ze	e
ƒZdd„ Zdd„ ZedkrÖddlmZ eƒ Ze de¡ e de¡ e ddd„ ¡ e ddd„ ¡ e ddd„ ¡ dS )zN
A benchmark which tries to compare the possible slow subparts of validation.
é    )ÚRegistry)ÚDRAFT202012)ÚHashTrieMapÚHashTrieSet)ÚDraft202012ValidatorÚarrayé   ÚtypeÚinteger)r	   Z	minLengthZ	maxLengthÚitemsc                   C   s   t  dd¡t d¡fS )NÚfooÚbar)ÚhmapÚinsertÚhset© r   r   úf/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/jsonschema/benchmarks/subcomponents.pyÚregistry_data_structures   s    r   c                  C   s   t  t¡} tjd| d�S )Nzurn:example)ÚuriÚresource)r   Zcreate_resourceÚschemaÚregistryZwith_resource)r   r   r   r   Úregistry_add   s    
r   Ú__main__)ÚRunnerzHashMap/HashSet insertionzRegistry insertionZSuccessc                   C   s   t  dg¡S )Nr   ©ÚvZis_validr   r   r   r   Ú<lambda>(   ó    r   ZFailurec                   C   s   t  dg¡S )Nr   r   r   r   r   r   r   )   r   zMetaschema validationc                   C   s
   t  t¡S )N)r   Zcheck_schemar   r   r   r   r   r   *   r   N)Ú__doc__Zreferencingr   Zreferencing.jsonschemar   Zrpdsr   r   Z
jsonschemar   r   r   r   r   r   r   r   Ú__name__Zpyperfr   ÚrunnerZ
bench_funcr   r   r   r   Ú<module>   s.   ü