Last active
December 31, 2015 08:09
-
-
Save v6ak/7958454 to your computer and use it in GitHub Desktop.
Benchmark provedený kritizovaným způsobem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ java -jar clojure-1.5.1.jar | |
| Clojure 1.5.1 | |
| user=> (defn plus-2-1 [n] (+ 2 n)) ; stary a nudny zpusob | |
| #'user/plus-2-1 | |
| user=> (def plus-2-2 (partial + 2)) ; partial application | |
| #'user/plus-2-2 | |
| user=> (def plus-2-3 (comp inc inc)) ; kompozice funkci | |
| #'user/plus-2-3 | |
| user=> "první měření" | |
| "první měření" | |
| user=> (time (dotimes [n 10000000] (plus-2-1 n))) | |
| "Elapsed time: 144.997384 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-2 n))) | |
| "Elapsed time: 895.716139 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-3 n))) | |
| "Elapsed time: 152.199401 msecs" | |
| nil | |
| user=> "druhé měření" | |
| "druhé měření" | |
| user=> (time (dotimes [n 10000000] (plus-2-1 n))) | |
| "Elapsed time: 208.223183 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-2 n))) | |
| "Elapsed time: 4143.839582 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-3 n))) | |
| "Elapsed time: 220.610431 msecs" | |
| nil | |
| user=> "třetí meření" | |
| "třetí meření" | |
| user=> (time (dotimes [n 10000000] (plus-2-1 n))) | |
| "Elapsed time: 60.548036 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-2 n))) | |
| "Elapsed time: 1294.795431 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-3 n))) | |
| "Elapsed time: 105.571946 msecs" | |
| nil | |
| user=> "čtvrté měření" | |
| "čtvrté měření" | |
| user=> (time (dotimes [n 10000000] (plus-2-1 n))) | |
| "Elapsed time: 64.756249 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-2 n))) | |
| "Elapsed time: 1303.530841 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-3 n))) | |
| "Elapsed time: 102.436558 msecs" | |
| nil | |
| user=> "páté měření" | |
| "páté měření" | |
| user=> (time (dotimes [n 10000000] (plus-2-1 n))) | |
| "Elapsed time: 74.633074 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-2 n))) | |
| "Elapsed time: 2161.644995 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-3 n))) | |
| "Elapsed time: 103.762366 msecs" | |
| nil | |
| user=> "šesté měření" | |
| "šesté měření" | |
| user=> (time (dotimes [n 10000000] (plus-2-1 n))) | |
| "Elapsed time: 72.074253 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-2 n))) | |
| "Elapsed time: 2378.82071 msecs" | |
| nil | |
| user=> (time (dotimes [n 10000000] (plus-2-3 n))) | |
| "Elapsed time: 111.57844 msecs" | |
| nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ java -version | |
| java version "1.7.0_04" | |
| Java(TM) SE Runtime Environment (build 1.7.0_04-b20) | |
| Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cat /proc/cpuinfo | |
| processor : 0 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 42 | |
| model name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz | |
| stepping : 7 | |
| microcode : 0x23 | |
| cpu MHz : 800.000 | |
| cache size : 6144 KB | |
| physical id : 0 | |
| siblings : 8 | |
| core id : 0 | |
| cpu cores : 4 | |
| apicid : 0 | |
| initial apicid : 0 | |
| fpu : yes | |
| fpu_exception : yes | |
| cpuid level : 13 | |
| wp : yes | |
| flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid | |
| bogomips : 4385.85 | |
| clflush size : 64 | |
| cache_alignment : 64 | |
| address sizes : 36 bits physical, 48 bits virtual | |
| power management: | |
| processor : 1 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 42 | |
| model name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz | |
| stepping : 7 | |
| microcode : 0x23 | |
| cpu MHz : 800.000 | |
| cache size : 6144 KB | |
| physical id : 0 | |
| siblings : 8 | |
| core id : 0 | |
| cpu cores : 4 | |
| apicid : 1 | |
| initial apicid : 1 | |
| fpu : yes | |
| fpu_exception : yes | |
| cpuid level : 13 | |
| wp : yes | |
| flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid | |
| bogomips : 4385.60 | |
| clflush size : 64 | |
| cache_alignment : 64 | |
| address sizes : 36 bits physical, 48 bits virtual | |
| power management: | |
| processor : 2 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 42 | |
| model name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz | |
| stepping : 7 | |
| microcode : 0x23 | |
| cpu MHz : 800.000 | |
| cache size : 6144 KB | |
| physical id : 0 | |
| siblings : 8 | |
| core id : 1 | |
| cpu cores : 4 | |
| apicid : 2 | |
| initial apicid : 2 | |
| fpu : yes | |
| fpu_exception : yes | |
| cpuid level : 13 | |
| wp : yes | |
| flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid | |
| bogomips : 4385.61 | |
| clflush size : 64 | |
| cache_alignment : 64 | |
| address sizes : 36 bits physical, 48 bits virtual | |
| power management: | |
| processor : 3 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 42 | |
| model name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz | |
| stepping : 7 | |
| microcode : 0x23 | |
| cpu MHz : 800.000 | |
| cache size : 6144 KB | |
| physical id : 0 | |
| siblings : 8 | |
| core id : 1 | |
| cpu cores : 4 | |
| apicid : 3 | |
| initial apicid : 3 | |
| fpu : yes | |
| fpu_exception : yes | |
| cpuid level : 13 | |
| wp : yes | |
| flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid | |
| bogomips : 4385.61 | |
| clflush size : 64 | |
| cache_alignment : 64 | |
| address sizes : 36 bits physical, 48 bits virtual | |
| power management: | |
| processor : 4 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 42 | |
| model name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz | |
| stepping : 7 | |
| microcode : 0x23 | |
| cpu MHz : 800.000 | |
| cache size : 6144 KB | |
| physical id : 0 | |
| siblings : 8 | |
| core id : 2 | |
| cpu cores : 4 | |
| apicid : 4 | |
| initial apicid : 4 | |
| fpu : yes | |
| fpu_exception : yes | |
| cpuid level : 13 | |
| wp : yes | |
| flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid | |
| bogomips : 4385.61 | |
| clflush size : 64 | |
| cache_alignment : 64 | |
| address sizes : 36 bits physical, 48 bits virtual | |
| power management: | |
| processor : 5 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 42 | |
| model name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz | |
| stepping : 7 | |
| microcode : 0x23 | |
| cpu MHz : 800.000 | |
| cache size : 6144 KB | |
| physical id : 0 | |
| siblings : 8 | |
| core id : 2 | |
| cpu cores : 4 | |
| apicid : 5 | |
| initial apicid : 5 | |
| fpu : yes | |
| fpu_exception : yes | |
| cpuid level : 13 | |
| wp : yes | |
| flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid | |
| bogomips : 4385.61 | |
| clflush size : 64 | |
| cache_alignment : 64 | |
| address sizes : 36 bits physical, 48 bits virtual | |
| power management: | |
| processor : 6 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 42 | |
| model name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz | |
| stepping : 7 | |
| microcode : 0x23 | |
| cpu MHz : 800.000 | |
| cache size : 6144 KB | |
| physical id : 0 | |
| siblings : 8 | |
| core id : 3 | |
| cpu cores : 4 | |
| apicid : 6 | |
| initial apicid : 6 | |
| fpu : yes | |
| fpu_exception : yes | |
| cpuid level : 13 | |
| wp : yes | |
| flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid | |
| bogomips : 4385.61 | |
| clflush size : 64 | |
| cache_alignment : 64 | |
| address sizes : 36 bits physical, 48 bits virtual | |
| power management: | |
| processor : 7 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 42 | |
| model name : Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz | |
| stepping : 7 | |
| microcode : 0x23 | |
| cpu MHz : 800.000 | |
| cache size : 6144 KB | |
| physical id : 0 | |
| siblings : 8 | |
| core id : 3 | |
| cpu cores : 4 | |
| apicid : 7 | |
| initial apicid : 7 | |
| fpu : yes | |
| fpu_exception : yes | |
| cpuid level : 13 | |
| wp : yes | |
| flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid | |
| bogomips : 4385.61 | |
| clflush size : 64 | |
| cache_alignment : 64 | |
| address sizes : 36 bits physical, 48 bits virtual | |
| power management: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ uname -a | |
| Linux ntb 3.2.0-57-generic #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment