Skip to content

Instantly share code, notes, and snippets.

@gabeno
Created July 24, 2015 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabeno/ea80e8aaf606c55c80a1 to your computer and use it in GitHub Desktop.
Save gabeno/ea80e8aaf606c55c80a1 to your computer and use it in GitHub Desktop.
List Timing Results
# tests done on an ubuntu vm
concat 1.65812611580 milliseconds
append 0.07023715973 milliseconds
list comprehension 0.03012800217 milliseconds
list range 0.00904202461 milliseconds
@gabeno
Copy link
Author

gabeno commented Jul 24, 2015

See code here: https://github.com/gabeno/cs/commit/8ebb77771d09ad0d65208048f587ec93e96033ef

Vm box details:

$ uname -a
Linux gm-server 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
stepping    : 1
microcode   : 0x19
cpu MHz     : 2407.737
cache size  : 6144 KB
physical id : 0
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl pni monitor ssse3 lahf_lm
bogomips    : 4815.47
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:
$ cat /proc/meminfo
MemTotal:        2049768 kB
MemFree:         1823936 kB
MemAvailable:    1864056 kB
Buffers:           32720 kB
Cached:           124344 kB
SwapCached:            0 kB
Active:            80468 kB
Inactive:          95540 kB
Active(anon):      21008 kB
Inactive(anon):     9628 kB
Active(file):      59460 kB
Inactive(file):    85912 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2097148 kB
SwapFree:        2097148 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         18984 kB
Mapped:            29468 kB
Shmem:             11696 kB
Slab:              24028 kB
SReclaimable:      14740 kB
SUnreclaim:         9288 kB
KernelStack:        2288 kB
PageTables:         3196 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     3122032 kB
Committed_AS:     211956 kB
VmallocTotal:   34359738367 kB
VmallocUsed:        7868 kB
VmallocChunk:   34359719492 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       18368 kB
DirectMap2M:     2078720 kB

@gabeno
Copy link
Author

gabeno commented Jul 24, 2015

factor in time for calling a function, eliminate this overhead (https://github.com/gabeno/cs/commit/5f45810826a616767a9aedcbe596366c556a5f20):

time for calling a function 0.00007104874 milliseconds
concat 1.61438107491 milliseconds
append 0.07360911369 milliseconds
list comprehension 0.02981185913 milliseconds
list range 0.00812816620 milliseconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment