Skip to content

Instantly share code, notes, and snippets.

@realazthat
Created November 27, 2012 18:10
Show Gist options
  • Save realazthat/4155964 to your computer and use it in GitHub Desktop.
Save realazthat/4155964 to your computer and use it in GitHub Desktop.
{
"units":
[
"Botan-1.10.3/src/algo_base/symkey.cpp",
"Botan-1.10.3/src/algo_factory/algo_factory.cpp",
"Botan-1.10.3/src/algo_factory/prov_weight.cpp",
"Botan-1.10.3/src/alloc/alloc_mmap/mmap_mem.cpp",
"Botan-1.10.3/src/alloc/mem_pool/mem_pool.cpp",
"Botan-1.10.3/src/alloc/system_alloc/defalloc.cpp",
"Botan-1.10.3/src/asn1/alg_id.cpp",
"Botan-1.10.3/src/asn1/asn1_alt.cpp",
"Botan-1.10.3/src/asn1/asn1_att.cpp",
"Botan-1.10.3/src/asn1/asn1_int.cpp",
"Botan-1.10.3/src/asn1/asn1_oid.cpp",
"Botan-1.10.3/src/asn1/asn1_str.cpp",
"Botan-1.10.3/src/asn1/asn1_tm.cpp",
"Botan-1.10.3/src/asn1/ber_dec.cpp",
"Botan-1.10.3/src/asn1/der_enc.cpp",
"Botan-1.10.3/src/asn1/x509_dn.cpp",
"Botan-1.10.3/src/benchmark/benchmark.cpp",
"Botan-1.10.3/src/block/aes/aes.cpp",
"Botan-1.10.3/src/block/blowfish/blfs_tab.cpp",
"Botan-1.10.3/src/block/blowfish/blowfish.cpp",
"Botan-1.10.3/src/block/camellia/camellia.cpp",
"Botan-1.10.3/src/block/cascade/cascade.cpp",
"Botan-1.10.3/src/block/cast/cast128.cpp",
"Botan-1.10.3/src/block/cast/cast256.cpp",
"Botan-1.10.3/src/block/cast/cast_tab.cpp",
"Botan-1.10.3/src/block/des/des.cpp",
"Botan-1.10.3/src/block/des/des_tab.cpp",
"Botan-1.10.3/src/block/des/desx.cpp",
"Botan-1.10.3/src/block/gost_28147/gost_28147.cpp",
"Botan-1.10.3/src/block/idea/idea.cpp",
"Botan-1.10.3/src/block/kasumi/kasumi.cpp",
"Botan-1.10.3/src/block/lion/lion.cpp",
"Botan-1.10.3/src/block/lubyrack/lubyrack.cpp",
"Botan-1.10.3/src/block/mars/mars.cpp",
"Botan-1.10.3/src/block/misty1/misty1.cpp",
"Botan-1.10.3/src/block/noekeon/noekeon.cpp",
"Botan-1.10.3/src/block/noekeon_simd/noekeon_simd.cpp",
"Botan-1.10.3/src/block/rc2/rc2.cpp",
"Botan-1.10.3/src/block/rc5/rc5.cpp",
"Botan-1.10.3/src/block/rc6/rc6.cpp",
"Botan-1.10.3/src/block/safer/safer_sk.cpp",
"Botan-1.10.3/src/block/seed/seed.cpp",
"Botan-1.10.3/src/block/seed/seed_tab.cpp",
"Botan-1.10.3/src/block/serpent/serpent.cpp",
"Botan-1.10.3/src/block/serpent_simd/serp_simd.cpp",
"Botan-1.10.3/src/block/skipjack/skipjack.cpp",
"Botan-1.10.3/src/block/square/sqr_tab.cpp",
"Botan-1.10.3/src/block/square/square.cpp",
"Botan-1.10.3/src/block/tea/tea.cpp",
"Botan-1.10.3/src/block/twofish/two_tab.cpp",
"Botan-1.10.3/src/block/twofish/twofish.cpp",
"Botan-1.10.3/src/block/xtea/xtea.cpp",
"Botan-1.10.3/src/block/xtea_simd/xtea_simd.cpp",
"Botan-1.10.3/src/cert/certstore/certstor.cpp",
"Botan-1.10.3/src/cert/cvc/asn1_eac_str.cpp",
"Botan-1.10.3/src/cert/cvc/asn1_eac_tm.cpp",
"Botan-1.10.3/src/cert/cvc/cvc_ado.cpp",
"Botan-1.10.3/src/cert/cvc/cvc_cert.cpp",
"Botan-1.10.3/src/cert/cvc/cvc_req.cpp",
"Botan-1.10.3/src/cert/cvc/cvc_self.cpp",
"Botan-1.10.3/src/cert/cvc/ecdsa_sig.cpp",
"Botan-1.10.3/src/cert/cvc/signed_obj.cpp",
"Botan-1.10.3/src/cert/pkcs10/pkcs10.cpp",
"Botan-1.10.3/src/cert/x509ca/x509_ca.cpp",
"Botan-1.10.3/src/cert/x509cert/x509_ext.cpp",
"Botan-1.10.3/src/cert/x509cert/x509_obj.cpp",
"Botan-1.10.3/src/cert/x509cert/x509cert.cpp",
"Botan-1.10.3/src/cert/x509crl/crl_ent.cpp",
"Botan-1.10.3/src/cert/x509crl/x509_crl.cpp",
"Botan-1.10.3/src/cert/x509self/x509opt.cpp",
"Botan-1.10.3/src/cert/x509self/x509self.cpp",
"Botan-1.10.3/src/cert/x509store/x509stor.cpp",
"Botan-1.10.3/src/checksum/adler32/adler32.cpp",
"Botan-1.10.3/src/checksum/crc24/crc24.cpp",
"Botan-1.10.3/src/checksum/crc32/crc32.cpp",
"Botan-1.10.3/src/cms/cms_algo.cpp",
"Botan-1.10.3/src/cms/cms_comp.cpp",
"Botan-1.10.3/src/cms/cms_dalg.cpp",
"Botan-1.10.3/src/cms/cms_dec.cpp",
"Botan-1.10.3/src/cms/cms_ealg.cpp",
"Botan-1.10.3/src/cms/cms_enc.cpp",
"Botan-1.10.3/src/codec/base64/base64.cpp",
"Botan-1.10.3/src/codec/hex/hex.cpp",
"Botan-1.10.3/src/codec/openpgp/openpgp.cpp",
"Botan-1.10.3/src/codec/pem/pem.cpp",
"Botan-1.10.3/src/constructs/aont/package.cpp",
"Botan-1.10.3/src/constructs/cryptobox/cryptobox.cpp",
"Botan-1.10.3/src/constructs/fpe_fe1/fpe_fe1.cpp",
"Botan-1.10.3/src/constructs/rfc3394/rfc3394.cpp",
"Botan-1.10.3/src/constructs/srp6/srp6.cpp",
"Botan-1.10.3/src/constructs/tss/tss.cpp",
"Botan-1.10.3/src/engine/core_engine/core_modes.cpp",
"Botan-1.10.3/src/engine/core_engine/def_pk_ops.cpp",
"Botan-1.10.3/src/engine/core_engine/def_powm.cpp",
"Botan-1.10.3/src/engine/core_engine/lookup_block.cpp",
"Botan-1.10.3/src/engine/core_engine/lookup_hash.cpp",
"Botan-1.10.3/src/engine/core_engine/lookup_mac.cpp",
"Botan-1.10.3/src/engine/core_engine/lookup_pbkdf.cpp",
"Botan-1.10.3/src/engine/core_engine/lookup_stream.cpp",
"Botan-1.10.3/src/engine/dyn_engine/dyn_engine.cpp",
"Botan-1.10.3/src/engine/engine.cpp",
"Botan-1.10.3/src/engine/openssl/bn_powm.cpp",
"Botan-1.10.3/src/engine/openssl/bn_wrap.cpp",
"Botan-1.10.3/src/engine/openssl/ossl_arc4.cpp",
"Botan-1.10.3/src/engine/openssl/ossl_bc.cpp",
"Botan-1.10.3/src/engine/openssl/ossl_md.cpp",
"Botan-1.10.3/src/engine/openssl/ossl_pk.cpp",
"Botan-1.10.3/src/engine/simd_engine/simd_engine.cpp",
"Botan-1.10.3/src/entropy/dev_random/dev_random.cpp",
"Botan-1.10.3/src/entropy/egd/es_egd.cpp",
"Botan-1.10.3/src/entropy/hres_timer/hres_timer.cpp",
"Botan-1.10.3/src/entropy/proc_walk/es_ftw.cpp",
"Botan-1.10.3/src/entropy/unix_procs/es_unix.cpp",
"Botan-1.10.3/src/entropy/unix_procs/unix_cmd.cpp",
"Botan-1.10.3/src/entropy/unix_procs/unix_src.cpp",
"Botan-1.10.3/src/filters/algo_filt.cpp",
"Botan-1.10.3/src/filters/basefilt.cpp",
"Botan-1.10.3/src/filters/buf_filt.cpp",
"Botan-1.10.3/src/filters/codec_filt/b64_filt.cpp",
"Botan-1.10.3/src/filters/codec_filt/hex_filt.cpp",
"Botan-1.10.3/src/filters/data_snk.cpp",
"Botan-1.10.3/src/filters/data_src.cpp",
"Botan-1.10.3/src/filters/fd_unix/fd_unix.cpp",
"Botan-1.10.3/src/filters/filter.cpp",
"Botan-1.10.3/src/filters/modes/cbc/cbc.cpp",
"Botan-1.10.3/src/filters/modes/cfb/cfb.cpp",
"Botan-1.10.3/src/filters/modes/cts/cts.cpp",
"Botan-1.10.3/src/filters/modes/eax/eax.cpp",
"Botan-1.10.3/src/filters/modes/eax/eax_dec.cpp",
"Botan-1.10.3/src/filters/modes/ecb/ecb.cpp",
"Botan-1.10.3/src/filters/modes/mode_pad/mode_pad.cpp",
"Botan-1.10.3/src/filters/modes/xts/xts.cpp",
"Botan-1.10.3/src/filters/out_buf.cpp",
"Botan-1.10.3/src/filters/pipe.cpp",
"Botan-1.10.3/src/filters/pipe_io.cpp",
"Botan-1.10.3/src/filters/pipe_rw.cpp",
"Botan-1.10.3/src/filters/pk_filts/pk_filts.cpp",
"Botan-1.10.3/src/filters/secqueue.cpp",
"Botan-1.10.3/src/hash/bmw_512/bmw_512.cpp",
"Botan-1.10.3/src/hash/comb4p/comb4p.cpp",
"Botan-1.10.3/src/hash/gost_3411/gost_3411.cpp",
"Botan-1.10.3/src/hash/has160/has160.cpp",
"Botan-1.10.3/src/hash/keccak/keccak.cpp",
"Botan-1.10.3/src/hash/md2/md2.cpp",
"Botan-1.10.3/src/hash/md4/md4.cpp",
"Botan-1.10.3/src/hash/md5/md5.cpp",
"Botan-1.10.3/src/hash/mdx_hash/mdx_hash.cpp",
"Botan-1.10.3/src/hash/par_hash/par_hash.cpp",
"Botan-1.10.3/src/hash/rmd128/rmd128.cpp",
"Botan-1.10.3/src/hash/rmd160/rmd160.cpp",
"Botan-1.10.3/src/hash/sha1/sha160.cpp",
"Botan-1.10.3/src/hash/sha2_32/sha2_32.cpp",
"Botan-1.10.3/src/hash/sha2_64/sha2_64.cpp",
"Botan-1.10.3/src/hash/skein/skein_512.cpp",
"Botan-1.10.3/src/hash/tiger/tig_tab.cpp",
"Botan-1.10.3/src/hash/tiger/tiger.cpp",
"Botan-1.10.3/src/hash/whirlpool/whrl_tab.cpp",
"Botan-1.10.3/src/hash/whirlpool/whrlpool.cpp",
"Botan-1.10.3/src/kdf/kdf.cpp",
"Botan-1.10.3/src/kdf/kdf1/kdf1.cpp",
"Botan-1.10.3/src/kdf/kdf2/kdf2.cpp",
"Botan-1.10.3/src/kdf/mgf1/mgf1.cpp",
"Botan-1.10.3/src/kdf/prf_ssl3/prf_ssl3.cpp",
"Botan-1.10.3/src/kdf/prf_tls/prf_tls.cpp",
"Botan-1.10.3/src/kdf/prf_x942/prf_x942.cpp",
"Botan-1.10.3/src/libstate/get_enc.cpp",
"Botan-1.10.3/src/libstate/global_rng.cpp",
"Botan-1.10.3/src/libstate/global_state.cpp",
"Botan-1.10.3/src/libstate/init.cpp",
"Botan-1.10.3/src/libstate/libstate.cpp",
"Botan-1.10.3/src/libstate/lookup.cpp",
"Botan-1.10.3/src/libstate/oid_lookup/oids.cpp",
"Botan-1.10.3/src/libstate/policy.cpp",
"Botan-1.10.3/src/libstate/scan_name.cpp",
"Botan-1.10.3/src/mac/cbc_mac/cbc_mac.cpp",
"Botan-1.10.3/src/mac/cmac/cmac.cpp",
"Botan-1.10.3/src/mac/hmac/hmac.cpp",
"Botan-1.10.3/src/mac/mac.cpp",
"Botan-1.10.3/src/mac/ssl3mac/ssl3_mac.cpp",
"Botan-1.10.3/src/mac/x919_mac/x919_mac.cpp",
"Botan-1.10.3/src/math/bigint/big_code.cpp",
"Botan-1.10.3/src/math/bigint/big_io.cpp",
"Botan-1.10.3/src/math/bigint/big_ops2.cpp",
"Botan-1.10.3/src/math/bigint/big_ops3.cpp",
"Botan-1.10.3/src/math/bigint/big_rand.cpp",
"Botan-1.10.3/src/math/bigint/bigint.cpp",
"Botan-1.10.3/src/math/bigint/divide.cpp",
"Botan-1.10.3/src/math/ec_gfp/point_gfp.cpp",
"Botan-1.10.3/src/math/mp/mp_asm.cpp",
"Botan-1.10.3/src/math/mp/mp_comba.cpp",
"Botan-1.10.3/src/math/mp/mp_karat.cpp",
"Botan-1.10.3/src/math/mp/mp_misc.cpp",
"Botan-1.10.3/src/math/mp/mp_monty.cpp",
"Botan-1.10.3/src/math/mp/mp_mulop.cpp",
"Botan-1.10.3/src/math/mp/mp_shift.cpp",
"Botan-1.10.3/src/math/numbertheory/dsa_gen.cpp",
"Botan-1.10.3/src/math/numbertheory/jacobi.cpp",
"Botan-1.10.3/src/math/numbertheory/make_prm.cpp",
"Botan-1.10.3/src/math/numbertheory/mp_numth.cpp",
"Botan-1.10.3/src/math/numbertheory/numthry.cpp",
"Botan-1.10.3/src/math/numbertheory/pow_mod.cpp",
"Botan-1.10.3/src/math/numbertheory/powm_fw.cpp",
"Botan-1.10.3/src/math/numbertheory/powm_mnt.cpp",
"Botan-1.10.3/src/math/numbertheory/primes.cpp",
"Botan-1.10.3/src/math/numbertheory/reducer.cpp",
"Botan-1.10.3/src/math/numbertheory/ressol.cpp",
"Botan-1.10.3/src/mutex/noop_mutex/mux_noop.cpp",
"Botan-1.10.3/src/mutex/pthreads/mux_pthr.cpp",
"Botan-1.10.3/src/passhash/bcrypt/bcrypt.cpp",
"Botan-1.10.3/src/passhash/passhash9/passhash9.cpp",
"Botan-1.10.3/src/pbe/get_pbe.cpp",
"Botan-1.10.3/src/pbe/pbes1/pbes1.cpp",
"Botan-1.10.3/src/pbe/pbes2/pbes2.cpp",
"Botan-1.10.3/src/pbkdf/pbkdf1/pbkdf1.cpp",
"Botan-1.10.3/src/pbkdf/pbkdf2/pbkdf2.cpp",
"Botan-1.10.3/src/pbkdf/pgps2k/pgp_s2k.cpp",
"Botan-1.10.3/src/pk_pad/eme.cpp",
"Botan-1.10.3/src/pk_pad/eme1/eme1.cpp",
"Botan-1.10.3/src/pk_pad/eme_pkcs/eme_pkcs.cpp",
"Botan-1.10.3/src/pk_pad/emsa1/emsa1.cpp",
"Botan-1.10.3/src/pk_pad/emsa1_bsi/emsa1_bsi.cpp",
"Botan-1.10.3/src/pk_pad/emsa2/emsa2.cpp",
"Botan-1.10.3/src/pk_pad/emsa3/emsa3.cpp",
"Botan-1.10.3/src/pk_pad/emsa4/emsa4.cpp",
"Botan-1.10.3/src/pk_pad/emsa_raw/emsa_raw.cpp",
"Botan-1.10.3/src/pk_pad/hash_id/hash_id.cpp",
"Botan-1.10.3/src/pubkey/blinding.cpp",
"Botan-1.10.3/src/pubkey/dh/dh.cpp",
"Botan-1.10.3/src/pubkey/dl_algo/dl_algo.cpp",
"Botan-1.10.3/src/pubkey/dl_group/dl_group.cpp",
"Botan-1.10.3/src/pubkey/dlies/dlies.cpp",
"Botan-1.10.3/src/pubkey/dsa/dsa.cpp",
"Botan-1.10.3/src/pubkey/ec_group/ec_group.cpp",
"Botan-1.10.3/src/pubkey/ecc_key/ecc_key.cpp",
"Botan-1.10.3/src/pubkey/ecdh/ecdh.cpp",
"Botan-1.10.3/src/pubkey/ecdsa/ecdsa.cpp",
"Botan-1.10.3/src/pubkey/elgamal/elgamal.cpp",
"Botan-1.10.3/src/pubkey/gost_3410/gost_3410.cpp",
"Botan-1.10.3/src/pubkey/if_algo/if_algo.cpp",
"Botan-1.10.3/src/pubkey/keypair/keypair.cpp",
"Botan-1.10.3/src/pubkey/nr/nr.cpp",
"Botan-1.10.3/src/pubkey/pk_algs.cpp",
"Botan-1.10.3/src/pubkey/pk_keys.cpp",
"Botan-1.10.3/src/pubkey/pkcs8.cpp",
"Botan-1.10.3/src/pubkey/pubkey.cpp",
"Botan-1.10.3/src/pubkey/pubkey_enums.cpp",
"Botan-1.10.3/src/pubkey/rsa/rsa.cpp",
"Botan-1.10.3/src/pubkey/rw/rw.cpp",
"Botan-1.10.3/src/pubkey/workfactor.cpp",
"Botan-1.10.3/src/pubkey/x509_key.cpp",
"Botan-1.10.3/src/rng/hmac_rng/hmac_rng.cpp",
"Botan-1.10.3/src/rng/randpool/randpool.cpp",
"Botan-1.10.3/src/rng/rng.cpp",
"Botan-1.10.3/src/rng/x931_rng/x931_rng.cpp",
"Botan-1.10.3/src/selftest/selftest.cpp",
"Botan-1.10.3/src/ssl/c_kex.cpp",
"Botan-1.10.3/src/ssl/cert_req.cpp",
"Botan-1.10.3/src/ssl/cert_ver.cpp",
"Botan-1.10.3/src/ssl/finished.cpp",
"Botan-1.10.3/src/ssl/hello.cpp",
"Botan-1.10.3/src/ssl/rec_read.cpp",
"Botan-1.10.3/src/ssl/rec_wri.cpp",
"Botan-1.10.3/src/ssl/s_kex.cpp",
"Botan-1.10.3/src/ssl/tls_client.cpp",
"Botan-1.10.3/src/ssl/tls_handshake_hash.cpp",
"Botan-1.10.3/src/ssl/tls_policy.cpp",
"Botan-1.10.3/src/ssl/tls_server.cpp",
"Botan-1.10.3/src/ssl/tls_session_key.cpp",
"Botan-1.10.3/src/ssl/tls_state.cpp",
"Botan-1.10.3/src/ssl/tls_suites.cpp",
"Botan-1.10.3/src/stream/arc4/arc4.cpp",
"Botan-1.10.3/src/stream/ctr/ctr.cpp",
"Botan-1.10.3/src/stream/ofb/ofb.cpp",
"Botan-1.10.3/src/stream/salsa20/salsa20.cpp",
"Botan-1.10.3/src/stream/stream_cipher.cpp",
"Botan-1.10.3/src/stream/turing/tur_tab.cpp",
"Botan-1.10.3/src/stream/turing/turing.cpp",
"Botan-1.10.3/src/stream/wid_wake/wid_wake.cpp",
"Botan-1.10.3/src/utils/assert.cpp",
"Botan-1.10.3/src/utils/charset.cpp",
"Botan-1.10.3/src/utils/cpuid.cpp",
"Botan-1.10.3/src/utils/datastor/datastor.cpp",
"Botan-1.10.3/src/utils/dyn_load/dyn_load.cpp",
"Botan-1.10.3/src/utils/mlock.cpp",
"Botan-1.10.3/src/utils/parsing.cpp",
"Botan-1.10.3/src/utils/time.cpp",
"Botan-1.10.3/src/utils/ui.cpp",
"Botan-1.10.3/src/utils/version.cpp",
"Botan-1.10.3/checks/bench.cpp",
"Botan-1.10.3/checks/bigint.cpp",
"Botan-1.10.3/checks/check.cpp",
"Botan-1.10.3/checks/cvc_tests.cpp",
"Botan-1.10.3/checks/dolook.cpp",
"Botan-1.10.3/checks/ec_tests.cpp",
"Botan-1.10.3/checks/ecdh.cpp",
"Botan-1.10.3/checks/ecdsa.cpp",
"Botan-1.10.3/checks/misc.cpp",
"Botan-1.10.3/checks/pk.cpp",
"Botan-1.10.3/checks/pk_bench.cpp",
"Botan-1.10.3/checks/timer.cpp",
"Botan-1.10.3/checks/validate.cpp"
],
"executable": "botan_test",
"link_libs": "ssl rt",
"include_directores": ["Botan-1.10.3/","Botan-1.10.3/build/include","Botan-1.10.3/src/filters"],
"command": "botan_test --benchmark"
}
Test Name Test Configuration Compiler Compiler Configuration Compiler Version String Header only Units Compile Time Link Time Build Time Run Time Re-compile Time AVG Re-compile Time MAX Re-link Time AVG Re-link Time MAX Re-build Time AVG Re-build Time MAX Compile Memory Link Memory Build Memory Run Memory Executable Size
Botan Benchmark Botan Benchmark gcc gcc default g++ (GCC) 4.6.1 False 301 153.512639046 1.90481901169 155.417458057 455.444045067 0.623229936904 2.42226004601 1.68530458073 2.84736204147 2.30853451764 4.18289113045 57974784 65277952 123252736 3108864 3693104
Botan Benchmark Botan Benchmark gcc gcc default g++ (GCC) 4.6.1 True 301 31.8454010487 1.08378386497 32.9291849136 455.065485001 37.1664250269 60.0829322338 1.16026142982 2.14584708214 38.3266864568 61.8065192699 315416576 29724672 345141248 3108864 3594345
Botan Benchmark Botan Benchmark gcc gcc opt native g++ (GCC) 4.6.1 False 301 335.882362127 0.808760166168 336.691122293 451.673640013 1.19652500897 9.00023698807 0.730953056551 1.13516592979 1.92747806552 9.58317995071 74227712 34877440 109105152 3104768 3668143
Botan Benchmark Botan Benchmark gcc gcc opt native g++ (GCC) 4.6.1 True 301 137.72614789 0.527410984039 138.253558874 451.771106958 136.965934422 240.968971014 0.402457541406 0.751816987991 137.368391963 241.522325993 382656512 19017728 401674240 3104768 2945301
Botan Benchmark Botan Benchmark gcc gcc size opt g++ (GCC) 4.6.1 False 301 224.816065073 0.922040939331 225.738106012 451.677594185 0.862808512691 6.53652715683 0.800869668441 1.27913999557 1.66367818113 7.49583601952 69599232 36999168 106598400 2834432 2607158
Botan Benchmark Botan Benchmark gcc gcc size opt g++ (GCC) 4.6.1 True 301 86.2728741169 0.507998943329 86.7808730602 451.705754042 99.0458434262 155.508162975 0.476727583084 0.826656103134 99.5225710093 156.334819078 374648832 18821120 393469952 2834432 2504957
{
"units":
[
"box2d-read-only/Box2D/glui/glui_tree.cpp",
"box2d-read-only/Box2D/glui/glui_rollout.cpp",
"box2d-read-only/Box2D/glui/glui_spinner.cpp",
"box2d-read-only/Box2D/glui/glui_node.cpp",
"box2d-read-only/Box2D/glui/glui_textbox.cpp",
"box2d-read-only/Box2D/glui/glui_separator.cpp",
"box2d-read-only/Box2D/glui/glui_window.cpp",
"box2d-read-only/Box2D/glui/glui_edittext.cpp",
"box2d-read-only/Box2D/glui/glui_translation.cpp",
"box2d-read-only/Box2D/glui/glui_listbox.cpp",
"box2d-read-only/Box2D/glui/glui_treepanel.cpp",
"box2d-read-only/Box2D/glui/glui_bitmaps.cpp",
"box2d-read-only/Box2D/glui/glui_statictext.cpp",
"box2d-read-only/Box2D/glui/glui_scrollbar.cpp",
"box2d-read-only/Box2D/glui/glui_panel.cpp",
"box2d-read-only/Box2D/glui/glui_filebrowser.cpp",
"box2d-read-only/Box2D/glui/glui_commandline.cpp",
"box2d-read-only/Box2D/glui/glui.cpp",
"box2d-read-only/Box2D/glui/glui_rotation.cpp",
"box2d-read-only/Box2D/glui/glui_bitmap_img_data.cpp",
"box2d-read-only/Box2D/glui/glui_list.cpp",
"box2d-read-only/Box2D/glui/glui_add_controls.cpp",
"box2d-read-only/Box2D/glui/glui_button.cpp",
"box2d-read-only/Box2D/glui/glui_radio.cpp",
"box2d-read-only/Box2D/glui/glui_control.cpp",
"box2d-read-only/Box2D/glui/glui_column.cpp",
"box2d-read-only/Box2D/glui/glui_mouse_iaction.cpp",
"box2d-read-only/Box2D/glui/glui_checkbox.cpp",
"box2d-read-only/Box2D/glui/glui_string.cpp",
"box2d-read-only/Box2D/glui/algebra3.cpp",
"box2d-read-only/Box2D/glui/arcball.cpp",
"box2d-read-only/Box2D/glui/quaternion.cpp",
"box2d-read-only/Box2D/Box2D/Collision/Shapes/b2ChainShape.cpp",
"box2d-read-only/Box2D/Box2D/Collision/Shapes/b2CircleShape.cpp",
"box2d-read-only/Box2D/Box2D/Collision/Shapes/b2EdgeShape.cpp",
"box2d-read-only/Box2D/Box2D/Collision/Shapes/b2PolygonShape.cpp",
"box2d-read-only/Box2D/Box2D/Collision/b2BroadPhase.cpp",
"box2d-read-only/Box2D/Box2D/Collision/b2CollideCircle.cpp",
"box2d-read-only/Box2D/Box2D/Collision/b2CollideEdge.cpp",
"box2d-read-only/Box2D/Box2D/Collision/b2CollidePolygon.cpp",
"box2d-read-only/Box2D/Box2D/Collision/b2Collision.cpp",
"box2d-read-only/Box2D/Box2D/Collision/b2Distance.cpp",
"box2d-read-only/Box2D/Box2D/Collision/b2DynamicTree.cpp",
"box2d-read-only/Box2D/Box2D/Collision/b2TimeOfImpact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/b2Body.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/b2ContactManager.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/b2Fixture.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/b2Island.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/b2World.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/b2WorldCallbacks.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2CircleContact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2Contact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2ContactSolver.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Contacts/b2PolygonContact.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2DistanceJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2FrictionJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2GearJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2Joint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2MotorJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2MouseJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2PulleyJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2RopeJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2WeldJoint.cpp",
"box2d-read-only/Box2D/Box2D/Dynamics/Joints/b2WheelJoint.cpp",
"box2d-read-only/Box2D/Box2D/Common/b2BlockAllocator.cpp",
"box2d-read-only/Box2D/Box2D/Common/b2Draw.cpp",
"box2d-read-only/Box2D/Box2D/Common/b2Math.cpp",
"box2d-read-only/Box2D/Box2D/Common/b2Settings.cpp",
"box2d-read-only/Box2D/Box2D/Common/b2StackAllocator.cpp",
"box2d-read-only/Box2D/Box2D/Common/b2Timer.cpp",
"box2d_bench1.cpp"
],
"executable": "box2d_test",
"link_libs": "GL GLEW glut GLU",
"include_directores": ["./box2d-read-only/Box2D","./box2d-read-only/Box2D/Box2D","./box2d-read-only/Box2D/Box2D/Common"]
}
#include <Box2D/Box2D.h>
#include <cstdio>
#include <time.h>
using namespace std;
// Turn this on to include the y-position of the top box in the output.
#define DEBUG 0
#define WARMUP 64
#define FRAMES 256
const int e_count = 100;
void bench() {
// Define the gravity vector.
b2Vec2 gravity(0.0f, -10.0f);
// Construct a world object, which will hold and simulate the rigid bodies.
b2World world(gravity);
world.SetAllowSleeping(false);
{
b2BodyDef bd;
b2Body* ground = world.CreateBody(&bd);
b2EdgeShape shape;
shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f));
ground->CreateFixture(&shape, 0.0f);
}
b2Body* topBody;
{
float32 a = 0.5f;
b2PolygonShape shape;
shape.SetAsBox(a, a);
b2Vec2 x(-7.0f, 0.75f);
b2Vec2 y;
b2Vec2 deltaX(0.5625f, 1);
b2Vec2 deltaY(1.125f, 0.0f);
for (int32 i = 0; i < e_count; ++i) {
y = x;
for (int32 j = i; j < e_count; ++j) {
b2BodyDef bd;
bd.type = b2_dynamicBody;
bd.position = y;
b2Body* body = world.CreateBody(&bd);
body->CreateFixture(&shape, 5.0f);
topBody = body;
y += deltaY;
}
x += deltaX;
}
}
for (int32 i = 0; i < WARMUP; ++i) {
world.Step(1.0f/60.0f, 3, 3);
}
clock_t times[FRAMES];
for (int32 i = 0; i < FRAMES; ++i) {
clock_t start = clock();
world.Step(1.0f/60.0f, 3, 3);
clock_t end = clock();
times[i] = end - start;
#if DEBUG
printf("%f :: ", topBody->GetPosition().y);
#endif
//printf("%f\n", (float32)(end - start) / CLOCKS_PER_SEC * 1000);
}
printf("\n");
clock_t total = 0;
for (int32 i = 0; i < FRAMES; ++i) {
total += times[i];
}
printf("%f\n", (float32)total / FRAMES / CLOCKS_PER_SEC * 1000);
}
int main(int argc, char** argv) {
bench();
return 0;
}
Test Name Test Configuration Compiler Compiler Configuration Compiler Version String Header only Units Compile Time Link Time Build Time Run Time Re-compile Time AVG Re-compile Time MAX Re-link Time AVG Re-link Time MAX Re-build Time AVG Re-build Time MAX Compile Memory Link Memory Build Memory Run Memory Executable Size
Box2D Benchmark Box2D Benchmark gcc gcc default g++ (GCC) 4.6.1 False 78 25.5244040489 0.301162004471 25.8255660534 110.145981073 0.39807223051 0.895567893982 0.312698923624 0.64998292923 0.710771154135 1.29840993881 27648000 15872000 43520000 38993920 578826
Box2D Benchmark Box2D Benchmark gcc gcc default g++ (GCC) 4.6.1 True 78 6.0461359024 0.226558923721 6.27269482613 128.564585924 6.62109800485 10.3249440193 0.216255835998 0.291131973267 6.83735384085 10.5680010319 89522176 12898304 102420480 38965248 564083
Box2D Benchmark Box2D Benchmark gcc gcc opt native g++ (GCC) 4.6.1 False 78 41.1130411625 0.248873949051 41.3619151115 38.3731060028 0.595473592098 2.01039481163 0.261070092519 0.360413074493 0.856543684617 2.27722978592 33275904 14499840 47775744 39354368 532599
Box2D Benchmark Box2D Benchmark gcc gcc opt native g++ (GCC) 4.6.1 True 78 22.6310861111 0.356183052063 22.9872691631 40.7278900146 23.1037857441 35.2124300003 0.172751576473 0.256994009018 23.2765373206 35.4224460125 163598336 11640832 175239168 39321600 556294
Box2D Benchmark Box2D Benchmark gcc gcc size opt g++ (GCC) 4.6.1 False 78 35.1573338509 0.345495939255 35.5028297901 46.5828249454 0.530295466765 1.58187198639 0.25627661974 0.506897926331 0.786572086505 1.87699508667 30494720 14360576 44855296 39088128 461494
Box2D Benchmark Box2D Benchmark gcc gcc size opt g++ (GCC) 4.6.1 True 78 14.1639511585 0.126606941223 14.2905580997 52.1985270977 14.9350762612 17.4372460842 0.173712097681 0.253824949265 15.1087883589 17.6634750366 116105216 11669504 127774720 39170048 455432
Box2D Benchmark Box2D Benchmark gcc gcc opt lto native g++ (GCC) 4.6.1 False 78 45.8212919235 25.6224191189 71.4437110424 39.7043790817 0.683624949211 2.3662109375 26.9825986899 40.0949640274 27.6662236391 40.8936259747 33636352 29302784 62939136 39276544 593841
Box2D Benchmark Box2D Benchmark gcc gcc opt lto native g++ (GCC) 4.6.1 True 78 25.8875281811 23.0383439064 48.9258720875 40.2095768452 25.3618819469 42.7685470581 23.8207547512 39.5830090046 49.1826366981 81.4119179249 166006784 22994944 189001728 39342080 565065
Box2D Benchmark Box2D Benchmark gcc gcc zero opt g++ (GCC) 4.6.1 False 78 27.2036919594 0.319149971008 27.5228419304 113.956959009 0.389133786544 0.852509021759 0.296826784427 0.54664683342 0.685960570971 1.36143684387 27791360 15884288 43675648 38985728 578826
Box2D Benchmark Box2D Benchmark gcc gcc zero opt g++ (GCC) 4.6.1 True 78 7.29883003235 0.209975004196 7.50880503654 117.544576883 7.20571806492 10.1423478127 0.226543065829 0.338179111481 7.43226113075 10.4442367554 89698304 12062720 101761024 38969344 564083
import sys
import matplotlib.pyplot as plt
csv_file_name = sys.argv[1]
print csv_file_name
lines = []
with open(csv_file_name,'r') as csv_fd:
for line in csv_fd:
lines.append(line)
datas = []
for i in range(len(lines)):
line = lines[i].strip()
if len(line):
line_datas = line.split(',')
datas.append(line_datas)
print datas
"""
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax1.xcorr([], y, usevlines=True, maxlags=50, normed=True, lw=2)
ax1.grid(True)
ax1.axhline(0, color='black', lw=2)
plt.show()
"""
test_name_index = datas[0].index("Test Name")
test_config_index = datas[0].index("Test Configuration")
compiler_name_index = datas[0].index("Compiler")
compiler_config_index = datas[0].index("Compiler Configuration")
header_only_index = datas[0].index("Header only")
compile_time_index = datas[0].index("Compile Time")
compile_memory_index = datas[0].index("Compile Memory")
link_time_index = datas[0].index("Link Time")
link_memory_index = datas[0].index("Link Memory")
build_time_index = datas[0].index("Build Time")
build_memory_index = datas[0].index("Build Memory")
run_time_index = datas[0].index("Run Time")
run_memory_index = datas[0].index("Run Memory")
exe_size_index = datas[0].index("Executable Size")
import numpy as np
import matplotlib.pyplot as plt
#Large page for 4 graphs
fig = plt.figure(figsize=(15.0,13.0))
#Small page for 1 graph
#fig = plt.figure(figsize=(15.0,4.0))
ax_list = []
#Uncomment/comment to enable/disable graphs to display.
#Only display as many graphs as the size of the page allows, see above
# fig = plt.figure(figsize=(15.0,13.0)) # this allows 4 graphs etc.
fields = [
("seconds",compile_time_index), ("seconds",link_time_index), ("seconds",build_time_index), ("seconds",run_time_index),
#("MB",compile_memory_index), ("MB",link_memory_index), ("MB",build_memory_index), ("MB",run_memory_index),
#("KB",exe_size_index),
]
#Fixes data to the correct type/scale, if you add new data field graphs, you should add the adjustment to this loop
for i in range(1,len(datas)):
print 'datas[i]:',datas[i]
datas[i][compile_time_index] = float(datas[i][compile_time_index])
datas[i][link_time_index] = float(datas[i][link_time_index])
datas[i][build_time_index] = float(datas[i][build_time_index])
datas[i][run_time_index] = float(datas[i][run_time_index])
datas[i][compile_memory_index] = float(datas[i][compile_memory_index])/(2<<20)
datas[i][link_memory_index] = float(datas[i][link_memory_index])/(2<<20)
datas[i][build_memory_index] = float(datas[i][build_memory_index])/(2<<20)
datas[i][run_memory_index] = float(datas[i][run_memory_index])/(2<<20)
datas[i][exe_size_index] = float(datas[i][exe_size_index])/(2<<10)
test_case_dict = {}
def test_case_key(test_case_data):
return test_case_data[test_name_index] \
+ test_case_data[test_config_index] \
+ test_case_data[compiler_name_index] \
+ test_case_data[compiler_config_index]
for i in range(1,len(datas)):
key = test_case_key(datas[i])
header_only = datas[i][header_only_index]
if key not in test_case_dict:
test_case_dict[key] = {}
test_case_dict[key][header_only] = datas[i]
for key,value in test_case_dict.iteritems():
#print value
assert 'True' in value
assert 'False' in value
for plot_index in range(len(fields)):
field_unit, field_index = fields[plot_index]
field_name = datas[0][field_index]
ax = fig.add_subplot(len(fields),1,plot_index + 1)
ax_list.append(ax)
multi_unit_values = []
single_unit_values = []
bar_names = []
for key,value in test_case_dict.iteritems():
single_unit_values.append(value['True'][field_index])
multi_unit_values.append(value['False'][field_index])
multi_unit_datas = value['False']
test_config = multi_unit_datas[test_config_index]
compiler_config = multi_unit_datas[compiler_config_index]
bar_names.append(test_config + '\n' + compiler_config)
#Add two blank bars to allow legend to display without overlapping existing bars
multi_unit_values += [0,0]
single_unit_values += [0,0]
bar_names += ['','']
N = len(bar_names)
#print 'N:',N
#print 'multi_unit_values:',multi_unit_values
#print 'single_unit_values:',single_unit_values
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars
rects1 = ax.bar(ind, single_unit_values, width, color='#006666')
rects2 = ax.bar(ind+width, multi_unit_values, width, color='#6699CC')
ax.set_ylabel(field_unit)
ax.set_title(field_name)
ax.set_xticks(ind+width)
ax.set_xticklabels( bar_names )
ax.legend( (rects1[0], rects2[0]), ('Single Unit', 'Multi Unit') )
#some horizontal spacing between the graphs
fig.subplots_adjust(hspace=.5)
fig.savefig('test.png', dpi=100)
from subprocess import call, Popen
import subprocess as subprocess
import os
import shutil
import time
import psutil
#from http://stackoverflow.com/questions/1158076/implement-touch-using-python
def touch(fname, times=None):
with file(fname, 'a'):
os.utime(fname, times)
def print_msg(msg):
print
print '----------------------------------------------------------------'
print msg
print '----------------------------------------------------------------'
print
class TestCase:
def __init__(self):
pass
def configure(self):
assert False
def build(self):
assert False
def run(self):
assert False
def get_compiler_name(self):
assert False
def get_compiler_version_string(self):
assert False
def get_units(self):
assert False
def get_name(self):
assert False
def get_compile_memory_footprint(self):
assert False
def get_link_memory_footprint(self):
assert False
def get_build_memory_footprint(self):
assert False
def get_run_memory_footprint(self):
assert False
def get_exe_size(self):
assert False
def get_compile_time(self):
assert False
def get_link_time(self):
assert False
def get_build_time(self):
assert False
def get_run_time(self):
assert False
def get_header_only(self):
assert False
class ProcessTimer:
def __init__(self,command):
self.command = command
self.execution_state = False
def execute(self):
self.max_vms_memory = 0
self.max_rss_memory = 0
self.t1 = None
self.t0 = time.time()
self.p = subprocess.Popen(self.command,shell=False)
self.execution_state = True
def poll(self):
if not self.check_execution_state():
return False
self.t1 = time.time()
try:
pp = psutil.Process(self.p.pid)
descendents = list(pp.get_children(recursive=True))
descendents = descendents + [pp]
rss_memory = 0
vms_memory = 0
for descendent in descendents:
try:
mem_info = descendent.get_memory_info()
rss_memory += mem_info[0]
vms_memory += mem_info[1]
except psutil.error.NoSuchProcess:
pass
self.max_vms_memory = max(self.max_vms_memory,vms_memory)
self.max_rss_memory = max(self.max_rss_memory,rss_memory)
except psutil.error.NoSuchProcess:
return self.check_execution_state()
return self.check_execution_state()
def is_running(self):
return psutil.pid_exists(self.p.pid) and self.p.poll() == None
def check_execution_state(self):
if not self.execution_state:
return False
if self.is_running():
return True
self.executation_state = False
self.t1 = time.time()
return False
def close(self,kill=False):
try:
pp = psutil.Process(self.p.pid)
if kill:
pp.kill()
else:
pp.terminate()
except psutil.error.NoSuchProcess:
pass
class GenericBench(TestCase):
def __init__(self,
header_only, bench_conf_name,
benchmark_name, data_file_name,
compiler_conf_name, compiler_name,
cc, cxx, ld, cc_flags, cxx_flags, ld_flags):
TestCase.__init__(self)
self._bench_conf_name = bench_conf_name
self._benchmark_name = benchmark_name
self._compiler_conf_name = compiler_conf_name
self._compiler_name = compiler_name
import json
data_file = open(data_file_name)
self._data = json.load(data_file)
self._units = self._data['units']
self._executable = self._data['executable']
if 'command' in self._data:
self._command = self._data['command']
else:
self._command = self._executable
self._header_only = header_only
self._compiler_name = compiler_name
self._cc = cc
self._cxx = cxx
self._ld = ld
self._cc_flags = cc_flags
self._cxx_flags = cxx_flags
self._ld_flags = ld_flags
def get_name(self):
return self._benchmark_name
def configure(self):
if os.path.exists('build'):
shutil.rmtree('build')
os.mkdir('build')
unit_build_paths = set()
for unit in self._units:
unit_build_path = 'build/' + os.path.dirname(unit)
unit_build_paths.add(unit_build_path)
for unit_build_path in unit_build_paths:
if not os.path.exists(unit_build_path):
os.makedirs(unit_build_path)
makefile = ""
include_directories = self._data['include_directores']
INCLUDE_DIRECTORES_CFLAGS = ' '.join(map(lambda include_directory: '-I"'+include_directory+'"', include_directories))
makefile += "CXXFLAGS := {0} {1}\n\n".format(INCLUDE_DIRECTORES_CFLAGS, self._cxx_flags)
makefile += "CXX = {0}\n\n".format(self._cxx)
makefile += "CC = {0}\n\n".format(self._cc)
makefile += "LD = {0}\n\n".format(self._ld)
makefile += "CFLAGS = {0} {1}\n\n".format(INCLUDE_DIRECTORES_CFLAGS,self._cc_flags)
makefile += "LDFLAGS = {0}\n\n".format(self._ld_flags)
cxx_units = []
cc_units = []
for unit in self._units:
root,ext = os.path.splitext(unit)
if ext == '.c':
cc_units.append(unit)
elif ext == '.cpp' or ext == '.cc':
cxx_units.append(unit)
else:
print 'unit:',unit
print 'ext:',ext
assert False
if self._header_only:
if len(cxx_units):
unity_cpp = ''
for unit in cxx_units:
unity_cpp += '#include "{unit}"\n'.format(unit=unit)
unity_cpp += "extern \"C\"{\n\n"
for unit in cc_units:
unity_cpp += '#include "{unit}"\n'.format(unit=unit)
unity_cpp += "} //extern \"C\"\n\n"
unity_cpp += '\n'
with open('build/unity.cpp','w') as unity_fd:
unity_fd.write(unity_cpp)
makefile += 'build/unity.o: build/unity.cpp\n\t$(CXX) -c "$<" -o "$@" $(CFLAGS) -I"."\n\n'
makefile += 'OBJECTS = {0}\n\n'.format( 'build/unity.o' )
makefile += 'compile: $(OBJECTS)\n\n'
else:
unity_c = ''
for unit in cc_units:
unity_c += '#include "{unit}"\n'.format(unit=unit)
unity_c += '\n'
with open('build/unity.c','w') as unity_fd:
unity_fd.write(unity_c)
makefile += 'build/unity.o: build/unity.c\n\t$(CC) -c "$<" -o "$@" $(CFLAGS) -I"."\n\n'
makefile += 'OBJECTS = {0}\n\n'.format( 'build/unity.o' )
makefile += 'compile: $(OBJECTS)\n\n'
else:
for unit in cc_units:
makefile += """
build/{unit}.o: {unit}
\t$(CC) -c "$<" -o "$@" $(CFLAGS)
""".format(unit=unit)
for unit in cxx_units:
makefile += """
build/{unit}.o: {unit}
\t$(CXX) -c "$<" -o "$@" $(CXXFLAGS)
""".format(unit=unit)
makefile += '\n'
makefile += 'OBJECTS = {0}\n\n'.format( ' '.join(map(lambda unit: 'build/{unit}.o'.format(unit=unit),self._units) ) )
makefile += 'compile: $(OBJECTS)\n\n'
link_libs = self._data['link_libs'].split(' ')
if len(self._data['link_libs']) == 0:
link_libs = []
LINK_LIBS = ' '.join(map(lambda lib: '-l'+lib, link_libs))
makefile += """
link: compile $(OBJECTS)
\t$(LD) $(OBJECTS) -o "build/{executable}" $(LDFLAGS) {link_libs}
""".format(executable=self._executable,link_libs=LINK_LIBS)
with open('build/Makefile','w') as make_fd:
make_fd.write(makefile)
def build(self):
p = ProcessTimer(['make', '--file=build/Makefile', 'compile'])
try:
p.execute()
while p.poll():
time.sleep(.01)
pass
finally:
p.close(kill=True)
if p.p.returncode != 0:
raise Exception("`make compile` failed")
self._compile_time = p.t1 - p.t0
self._compile_memory_footprint = p.max_rss_memory
p = ProcessTimer(['make', '--file=build/Makefile', 'link'])
try:
p.execute()
while p.poll():
time.sleep(.01)
pass
finally:
p.close(kill=True)
if p.p.returncode != 0:
raise Exception("`make compile` failed")
self._link_time = p.t1- p.t0
self._link_memory_footprint = p.max_rss_memory
self._build_time = self._compile_time + self._link_time
self._build_memory_footprint = self._compile_memory_footprint + self._link_memory_footprint
def run(self):
cwd = os.getcwd()
try:
os.chdir('build')
command = self._command.split(' ')
p = ProcessTimer(command)
try:
p.execute()
while p.poll():
time.sleep(.01)
pass
finally:
p.close(kill=True)
if p.p.returncode != 0:
raise Exception("running benchmark failed")
self._run_time = p.t1 - p.t0
self._run_memory_footprint = p.max_rss_memory
finally:
os.chdir(cwd)
def get_units(self):
return self._units
def get_compiler_name(self):
return self._compiler_name
def get_compiler_version_string(self):
version_str = subprocess.check_output([self._cxx, '--version'])
version_str = version_str.split('\n')
version_str = version_str[0]
return version_str
def get_exe_size(self):
cwd = os.getcwd()
try:
os.chdir('build')
return os.path.getsize(self._executable)
finally:
os.chdir(cwd)
def get_run_time(self):
return self._run_time
def get_link_time(self):
return self._link_time
def get_compile_time(self):
return self._compile_time
def get_build_time(self):
return self._build_time
def get_compile_memory_footprint(self):
return self._compile_memory_footprint
def get_link_memory_footprint(self):
return self._link_memory_footprint
def get_build_memory_footprint(self):
return self._build_memory_footprint
def get_run_memory_footprint(self):
return self._run_memory_footprint
def get_header_only(self):
return self._header_only
def get_compiler_conf(self):
return self._compiler_conf_name
def get_conf_name(self):
return self._bench_conf_name
#bench_conf_name, benchmark_name, data_file_name, bench_cc_flags, bench_cxx_flags,bench_ld_flags
test_base_cases = [
('Box2D Benchmark', 'Box2D Benchmark', 'box2d.data', '','',''),
('Botan Benchmark', 'Botan Benchmark', 'botan_bench.data', '','',''),
]
#compiler_conf_name, compiler_name,cc,cxx,ld,cc_flags,cxx_flags,ld_flags
compiler_configurations = [
('gcc default','gcc','gcc','g++','g++','','',''),
('gcc opt native','gcc','gcc','g++','g++','-O3 -march=native','-O3 -march=native','-O3 -march=native'),
('gcc size opt','gcc','gcc','g++','g++','-Os','-Os','-Os'),
('gcc opt lto native','gcc','gcc','g++','g++','-O3 -flto -march=native','-O3 -flto -march=native','-O3 -flto -march=native'),
('gcc zero opt','gcc','gcc','g++','g++','-O0','-O0','-O0'),
('clang default','clang','clang','clang++','clang++','','',''),
('clang opt native','clang','clang','clang++','clang++','-O3 -march=native','-O3 -march=native','-O3 -march=native'),
('clang size opt','clang','clang','clang++','clang++','-Os','-Os','-Os'),
('clang opt lto native','clang','clang','clang++','clang++','-O3 -flto -march=native','-O3 -flto -march=native','-O3 -flto -march=native'),
('clang zero opt','clang','clang','clang++','clang++','-O0','-O0','-O0'),
('icc default','icc','icc','icpc','icpc','','',''),
('icc opt native','icc','icc','icpc','icpc','-O3 -march=native','-O3 -march=native','-O3 -march=native'),
('icc size opt','icc','icc','icpc','icpc','-Os','-Os','-Os'),
('icc opt ipo native','icc','icc','icpc','icpc','-O3 -ipo -march=native','-O3 -ipo -march=native','-O3 -ipo -march=native'),
('icc zero opt','icc','icc','icpc','icpc','-O0','-O0','-O0'),
]
test_cases = []
#Create all combinations of bases-tests * is-header-only * compiler configurations
for compiler_config in compiler_configurations:
for test_base_case in test_base_cases:
bench_conf_name, benchmark_name, data_file_name, bench_cc_flags, bench_cxx_flags, bench_ld_flags = test_base_case
for header_only in [False,True]:
compiler_conf_name, compiler_name,cc,cxx,ld,cxx_flags,cc_flags,ld_flags = compiler_config
#header_only, bench_conf_name, benchmark_name, data_file_name, compiler_conf_name, compiler_name,
#cc, cxx, ld, cc_flags, cxx_flags, ld_flags
test_case = GenericBench(header_only,bench_conf_name, benchmark_name, data_file_name,
compiler_conf_name, compiler_name,cc,cxx,ld,
bench_cc_flags + ' ' + cc_flags,
bench_cxx_flags + ' ' + cxx_flags,
bench_ld_flags + ' ' + ld_flags)
test_cases.append(test_case)
#test_cases = [GenericBench(False,"Box2D Benchmark","Box2D Benchmark",'box2d.data',
# 'icc default','icc', 'icc', 'icpc','icpc','','','')]
#test_cases = [GenericBench(False,"botan","botan",'botan_bench.data',
# 'gcc default','gcc', 'gcc', 'g++','g++','','','')]
columns = ["Test Name", "Test Configuration", "Compiler", "Compiler Configuration", "Compiler Version String",
"Header only", "Units",
"Compile Time", "Link Time", "Build Time", "Run Time",
"Re-compile Time AVG", "Re-compile Time MAX",
"Re-link Time AVG", "Re-link Time MAX",
"Re-build Time AVG", "Re-build Time MAX",
"Compile Memory", "Link Memory", "Build Memory", "Run Memory",
"Executable Size",
]
datas = []
with open('data.csv','w') as csv_fd:
csv_top_line = ','.join(columns)
csv_fd.write(csv_top_line)
csv_fd.write('\n')
csv_fd.flush()
for test_case in test_cases:
test_datas = {}
test_datas["Compiler"] = test_case.get_compiler_name()
test_datas["Test Name"] = test_case.get_name()
test_datas["Test Configuration"] = test_case.get_conf_name()
test_datas["Compiler Configuration"] = test_case.get_compiler_conf()
test_datas['Header only'] = test_case.get_header_only()
test_datas["Compiler Version String"] = test_case.get_compiler_version_string()
print_msg('CONFIGURING')
test_case.configure()
print_msg('BUILDING')
test_case.build()
print_msg('RUNNING BENCHMARK')
test_case.run()
units = test_case.get_units()
test_datas['Units'] = len(units)
test_datas['Build Time'] = test_case.get_build_time()
test_datas['Compile Time'] = test_case.get_compile_time()
test_datas['Run Time'] = test_case.get_run_time()
test_datas['Executable Size'] = test_case.get_exe_size()
test_datas['Link Time'] = test_case.get_link_time()
test_datas['Compile Memory'] = test_case.get_compile_memory_footprint()
test_datas['Link Memory'] = test_case.get_link_memory_footprint()
test_datas['Build Memory'] = test_case.get_build_memory_footprint()
test_datas['Run Memory'] = test_case.get_run_memory_footprint()
recompile_time_sum = 0
relink_time_sum = 0
rebuild_time_sum = 0
max_recompile_time = 0
max_relink_time = 0
max_rebuild_time = 0
for unit in units:
if not test_case.get_header_only():
touch(unit)
else:
test_case.configure()
test_case.build()
unit_recompile_time = test_case.get_compile_time()
unit_relink_time = test_case.get_link_time()
unit_rebuild_time = unit_recompile_time + unit_relink_time
recompile_time_sum += unit_recompile_time
relink_time_sum += unit_relink_time
rebuild_time_sum += unit_rebuild_time
max_recompile_time = max(max_recompile_time,unit_recompile_time)
max_relink_time = max(max_relink_time,unit_relink_time)
max_rebuild_time = max(max_rebuild_time, unit_recompile_time + unit_relink_time)
test_datas['Re-compile Time AVG'] = float(recompile_time_sum) / len(units)
test_datas['Re-link Time AVG'] = float(relink_time_sum) / len(units)
test_datas['Re-build Time AVG'] = float(rebuild_time_sum) / len(units)
test_datas['Re-compile Time MAX'] = max_recompile_time
test_datas['Re-link Time MAX'] = max_relink_time
test_datas['Re-build Time MAX'] = max_rebuild_time
row = []
for column in columns:
row.append(test_datas[column])
csv_fd.write(','.join(map(str,row))+'\n')
csv_fd.flush()
datas.append(test_datas)
import pprint
pp = pprint.PrettyPrinter(indent=4)
print 'datas:'
pp.pprint(datas)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment