<s> """<STR_LIT>""" <EOL> import time <EOL> import re <EOL> from anima . render . arnold import base85 <EOL> from struct import pack , unpack <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> repeat = <NUM_LIT:1> <EOL> num_of_data = <NUM_LIT> <EOL> print ( '<STR_LIT>' % repeat ) <EOL> print ( '<STR_LIT>' % num_of_data ) <EOL> start = time . time ( ) <EOL> data = '<STR_LIT>' . join ( [ pack ( '<STR_LIT>' , i ) for i in range ( num_of_data ) ] ) <EOL> end = time . time ( ) <EOL> generating_data = end - start <EOL> print ( '<STR_LIT>' % generating_data ) <EOL> start = time . time ( ) <EOL> unpacked_data = unpack ( '<STR_LIT>' % ( len ( data ) // <NUM_LIT:4> ) , data ) <EOL> end = time . time ( ) <EOL> unpacking_data = end - start <EOL> print ( '<STR_LIT>' % len ( unpacked_data ) ) <EOL> print ( '<STR_LIT>' % unpacking_data ) <EOL> print ( '<STR_LIT>' ) <EOL> start = time . time ( ) <EOL> normal_encoded_data = base85 . arnold_b85_encode ( data ) <EOL> end = time . time ( ) <EOL> encode_duration = end - start <EOL> print ( '<STR_LIT>' % ( repeat , encode_duration ) ) <EOL> print ( '<STR_LIT>' % ( encode_duration / repeat ) ) <EOL> print ( '<STR_LIT>' ) <EOL> start = time . time ( ) <EOL> thread_encoded_data = base85 . arnold_b85_encode_multithreaded ( data ) <EOL> end = time . time ( ) <EOL> encode_duration = end - start <EOL> print ( '<STR_LIT>' % ( repeat , encode_duration ) ) <EOL> print ( '<STR_LIT>' % ( encode_duration / repeat ) ) <EOL> assert normal_encoded_data == thread_encoded_data <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> start = time . time ( ) <EOL> regex_splitted_data = re . sub ( "<STR_LIT>" , "<STR_LIT>" , normal_encoded_data , <NUM_LIT:0> ) <EOL> end = time . time ( ) <EOL> print ( '<STR_LIT>' % ( end - start ) ) <EOL> print ( '<STR_LIT>' ) <EOL> start = time . time ( ) <EOL> list_splitted_data = [ ] <EOL> for i in range ( <NUM_LIT:0> , len ( normal_encoded_data ) , <NUM_LIT> ) : <EOL> list_splitted_data . append ( normal_encoded_data [ i : i + <NUM_LIT> ] ) <EOL> list_splitted_data = '<STR_LIT:\n>' . join ( list_splitted_data ) <EOL> end = time . time ( ) <EOL> print ( '<STR_LIT>' % ( end - start ) ) </s>
