[gambit-list] Comparing a 2020 iPhone SE to a 7-year-old Linux box

Bradley Lucier lucier at purdue.edu
Sun May 24 00:20:29 EDT 2020


The Linux box is running Ubuntu 18.04 with

model name	: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz

and Gambit was compiled with

v4.9.3-1111-g05060cf0 20200521224855 x86_64-pc-linux-gnu "./configure 
'CC=/usr/local/gcc-10.1.0/bin/gcc -march=native 
-D___CAN_IMPORT_CLIB_DYNAMICALLY' '--enable-strict-aliasing' 
'--enable-single-host' '--enable-shared' '--enable-multiple-versions'"

The iPhone SE is running the Gambit REPL app, based on Gambit 4.7.4.

The comparison is very simple, I run

gsi -e '(define a (time (expt 3 100000000)))(pp (time (integer-length (* 
a a))))'
(time (expt 3 100000000))
     2.663234 secs real time
     2.633248 secs cpu time (2.434250 user, 0.198998 system)
     8 collections accounting for 0.020154 secs real time (0.006686 
user, 0.012848 system)
     1210688 bytes allocated
     272088 minor faults
     no major faults
(time (integer-length (* a a)))
     2.877121 secs real time
     2.869723 secs cpu time (2.665860 user, 0.203863 system)
     1 collection accounting for 0.019379 secs real time (0.000000 user, 
0.018940 system)
     85536 bytes allocated
     272140 minor faults
     no major faults
316992501

on the Linux box, the times on the iPhone SE are 2.759 seconds for the 
first computation and 2.990 seconds for the second.

If I look at an older build of Gambit on the Linux box, with

v4.9.1 20180930122740 x86_64-unknown-linux-gnu "./configure 'CC=gcc 
-march=native -D___CAN_IMPORT_CLIB_DYNAMICALLY' '--enable-single-host' 
'--enable-shared' '--enable-multiple-versions'"

i.e., with an older compiler and without --enable-strict-aliasing, then 
I see

gsi -e '(define a (time (expt 3 100000000)))(pp (time (integer-length (* 
a a))))'
(time (expt 3 100000000))
     3.328249 secs real time
     3.327808 secs cpu time (3.103869 user, 0.223939 system)
     8 collections accounting for 0.019851 secs real time (0.004052 
user, 0.015809 system)
     1213248 bytes allocated
     272088 minor faults
     no major faults
(time (integer-length (* a a)))
     3.572195 secs real time
     3.571591 secs cpu time (3.335618 user, 0.235973 system)
     1 collection accounting for 0.020848 secs real time (0.000757 user, 
0.020061 system)
     85536 bytes allocated
     272140 minor faults
     no major faults
316992501

i.e., the iPhone is undeniably faster.

I heard a rumor that Apple will start shipping Arm-based Macbook laptops 
with CPUs of its own design, maybe not the Macbook Pros, just the 
Macbook Airs.  That certainly doesn't look unreasonable.

Brad




More information about the Gambit-list mailing list