Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
Compile stats #111011
10/09/17 09:46 PM
10/09/17 09:46 PM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 146
So it's fun to know how long and how many resources a compile takes:

I'm using ubuntu 17.04.

you can use the shell's built in time command

time make -j4

and that will put out something like:

time make -j4
GCC 6.3.0 detected
Compiling src/emu/natkeyboard.cpp...
Archiving libemu.a...
Linking mame64...

real 0m20.428s
user 0m18.012s
sys 0m2.448s

but how much memory does it take?

let's use /usr/bin/time

/usr/bin/time make -j4
GCC 6.3.0 detected
Compiling src/emu/natkeyboard.cpp...
Archiving libemu.a...
Linking mame64...
18.06user 2.48system 0:27.43elapsed 74%CPU (0avgtext+0avgdata 1705048maxresident)k
104176inputs+560208outputs (1146major+1002703minor)pagefaults 0swaps

and if you want a verbose output use

/usr/bin/time --verbose make -j4

and for a full make of mame 0190 on a Intel Core i3-3220 CPU @ 3.30GHz × 4 takes about 55 minutes.

/usr/bin/time --verbose make -j4
GCC 6.3.0 detected
...
Compiling src/mame/mame.cpp...
Compiling generated/version.cpp...
Building driver list...
34618 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...
Command being timed: "make -j4"
User time (seconds): 11907.65
System time (seconds): 557.14
Percent of CPU this job got: 376%
Elapsed (wall clock) time (h:mm:ss or m:ss): 55:08.90
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 2241060
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 1547
Minor (reclaiming a frame) page faults: 221300921
Voluntary context switches: 385912
Involuntary context switches: 1218757
Swaps: 0
File system inputs: 472136
File system outputs: 5079616
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Re: Compile stats [Re: Golden Child] #111012
10/10/17 01:40 AM
10/10/17 01:40 AM
Joined: Feb 2004
Posts: 1,981
Sydney, Australia
Vas Crabb Offline
Very Senior Member
Vas Crabb  Offline
Very Senior Member
Joined: Feb 2004
Posts: 1,981
Sydney, Australia
luaengine.cpp is the killer - why not profile that? wink

Re: Compile stats [Re: Vas Crabb] #111021
10/10/17 01:00 PM
10/10/17 01:00 PM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 146
How do I profile luaengine.cpp?



full compile latest git pull on an Intel Core i5 CPU 750 @ 2.67GHz x 4 cores takes 43 minutes

make clean
/usr/bin/time --verbose make -j4
GCC 6.3.0 detected
...
Building driver list...
34621 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...
Command being timed: "make -j4"
User time (seconds): 8749.88
System time (seconds): 509.38
Percent of CPU this job got: 358%
Elapsed (wall clock) time (h:mm:ss or m:ss): 42:59.68
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 2235824
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 7201
Minor (reclaiming a frame) page faults: 221822793
Voluntary context switches: 401964
Involuntary context switches: 1496542
Swaps: 0
File system inputs: 1993784
File system outputs: 5175168
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz
stepping : 5
microcode : 0x7
cpu MHz : 2799.000
cache size : 8192 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
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 rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid dtherm ida
bugs :
bogomips : 5320.30
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

Re: Compile stats [Re: Golden Child] #111225
11/03/17 12:37 AM
11/03/17 12:37 AM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 146
For fun, I dug out my old Toshiba Laptop with a 32 bit processor to see how mame would do a full compile with Ubuntu 16.04 LTS.

Genuine Intel® CPU U2500 @ 1.20GHz × 2
32 bit
2.0 GiB
Ubuntu 16.04 LTS
compiling mame191

I fell asleep waiting and the computer went to sleep due to inactivity, but it said about 5 hours of elapsed time. I would guess somewhere around 3 hours since 21997 cpu seconds/ 2 cores/ 3600 seconds per hour = 3.05 hours.

Code
/usr/bin/time make -j3
GCC 5.4.0 detected
...
Compiling src/mame/mame.cpp...
Compiling generated/version.cpp...
Building driver list...
34653 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame...
21997.50user 1333.74system 5:04:54elapsed 127%CPU (0avgtext+0avgdata 1276864maxresident)k
3508360inputs+4227088outputs (8822major+151301401minor)pagefaults 0swaps



My cool discovery of the day is the -verbose option where it will tell you all about the compiler settings used to build mame.
Code
./mame pacman -rompath ../../mameroms/ -video opengl -verbose
Available videodrivers: x11 mir wayland dummy 
Current Videodriver: x11
	Display #0
		Renderdrivers:
			    opengl (0x0)
			 opengles2 (0x0)
			  software (0x0)
Available audio drivers: 
	pulseaudio          
	alsa                
	sndio               
	dsp                 
	disk                
	dummy               
Build version:      0.191 (unknown)
Build architecure:  
Build defines 1:    SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1 
Build defines 1:    LSB_FIRST=1 
SDL/OpenGL defines: SDL_COMPILEDVERSION=2004 USE_OPENGL=1 
Compiler defines A: __GNUC__=5 __GNUC_MINOR__=4 __GNUC_PATCHLEVEL__=0 __VERSION__="5.4.0 20160609" 
Compiler defines B: __unix__=1 __i386__=1 
Compiler defines C: __USE_FORTIFY_LEVEL=0 
Enter init_monitors
Adding monitor screen0 (1280 x 800)
Leave init_monitors
Enter sdlwindow_init
Using SDL multi-window OpenGL driver (SDL 2.0+)
... <snip>

GL texture: copy 1, shader 0, dynamic 1, 288x224 288x224 [PALETTE16, Equal: 0, Palette: 1,
            scale 1x1, border 0, pitch 384,288/2048], bytes/pix 4
GL texture: copy 1, shader 0, dynamic 1, 288x224 288x224 [PALETTE16, Equal: 0, Palette: 1,
            scale 1x1, border 0, pitch 384,288/2048], bytes/pix 4
Average speed: 100.00% (7 seconds)
sdl_kill: closing audio
Enter sdlwindow_exit
Leave sdlwindow_exit

Re: Compile stats [Re: Vas Crabb] #111344
11/23/17 05:18 PM
11/23/17 05:18 PM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 146
Originally Posted by Vas Crabb
luaengine.cpp is the killer - why not profile that? wink


Ok, if I make any change to luaengine.cpp (even just typing a space character) or enabling SOL_CHECK_ARGUMENTS for example:

Code
#define SOL_CHECK_ARGUMENTS
#include "sol2/sol.hpp"

Let's see how long it takes to re-compile and link,
Code
time make -j5
GCC 7 detected
Compiling src/frontend/mame/luaengine.cpp...
Compiling src/frontend/mame/clifront.cpp...
Compiling src/frontend/mame/mame.cpp...
Compiling src/frontend/mame/ui/datmenu.cpp...
Compiling src/frontend/mame/ui/mainmenu.cpp...
Compiling src/frontend/mame/ui/pluginopt.cpp...
Compiling src/frontend/mame/ui/selgame.cpp...
Compiling src/frontend/mame/ui/selmenu.cpp...
Compiling src/frontend/mame/ui/selsoft.cpp...
Compiling src/frontend/mame/ui/ui.cpp...
Archiving libfrontend.a...
Linking mame64...

real	2m2.940s
user	2m21.165s
sys	0m6.695s


Code
cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 3292.334

Re: Compile stats [Re: Golden Child] #112227
01/19/18 02:25 AM
01/19/18 02:25 AM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 146
I got an i7-2600 system and thought I'd give it a go compiling mame 193. It only took 29 minutes... whee!

Code
~/Downloads/mame193_extract/mame$ /usr/bin/time make -j8
GCC 7 detected
...
34845 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...
11973.80user 662.42system 29:32.70elapsed 712%CPU (0avgtext+0avgdata 2337696maxresident)k
2545752inputs+5575944outputs (12333major+234574396minor)pagefaults 0swaps

~/Downloads/mame193_extract/mame$ lscpu

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               42
Model name:          Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
Stepping:            7
CPU MHz:             3392.293
CPU max MHz:         3800.0000
CPU min MHz:         1600.0000
BogoMIPS:            6784.58
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            8192K
NUMA node0 CPU(s):   0-7
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 rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts

Re: Compile stats [Re: Golden Child] #112233
01/19/18 01:46 PM
01/19/18 01:46 PM
Joined: Mar 2001
Posts: 15,988
USA
R
R. Belmont Online content
Very Senior Member
R. Belmont  Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 15,988
USA
Golden Child: I thought you'd find this interesting:

https://www.ebay.com/itm/VDP-1000-board-for-CP-M-Turbo-7-Run-SG-1000-Some-Colecovision-games-on-APPLE-II/282518811724?_trkparms=aid%3D222007%26algo%3DSIM.MBE%26ao%3D2%26asc%3D47300%26meid%3Db377bd165ced41c2b2404240b204bb3b%26pid%3D100623%26rk%3D3%26rkt%3D6%26sd%3D282645562451&_trksid=p2047675.c100623.m-1

It's an daughtercard for a specific (modern) Apple II Z80 board that adds the TMS9928 VDP and SN76489A sound chip at the right Z80 I/O ports so you can run unmodified SG-1000 and some Colecovision games. Genius idea, I'll emulate it in MAME soon smile

Re: Compile stats [Re: R. Belmont] #112282
01/23/18 01:22 AM
01/23/18 01:22 AM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline OP
Senior Member
Golden Child  Offline OP
Senior Member
G
Joined: Feb 2014
Posts: 146
Hey RB,

Oh yeah! That's really cool. Can't wait!



If it helps, I came across a manual for the VDP-1000.

http://quick09.tistory.com/attachment/cfile9.uf@245A6F405957414B121465.pdf

and he's got some posts on his website:


http://quick09.tistory.com/category/%E2%97%86%20My%20Z80%20Card


The fusion of Apple and MSX. I wonder why MS never did an add-in MSX card for the apple II.

Ian Kim's also got an ApMSX card that he's working on.






And check this prototype out: A dual ti9929 video card!

[Linked Image]

http://a2central.com/category/its-a-hack/
http://a2central.com/7211/another-p...ice-monupet-ti-d-vdp9929a-graphics-card/

Re: Compile stats [Re: Golden Child] #112286
01/23/18 10:55 AM
01/23/18 10:55 AM
Joined: Jul 2007
Posts: 209
California
M
Monotremata Offline
Senior Member
Monotremata  Offline
Senior Member
M
Joined: Jul 2007
Posts: 209
California
Hah "Man The Goonies sucks, Im gonna go play Ultima 4." Is the MSX the expansion card thats too big for the case? Whats the Apple doing just power?

Re: Compile stats [Re: Golden Child] #112289
01/23/18 12:58 PM
01/23/18 12:58 PM
Joined: Mar 2001
Posts: 15,988
USA
R
R. Belmont Online content
Very Senior Member
R. Belmont  Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 15,988
USA
The Apple also uploads the Z80 code to run and provides the keyboard.

Page 1 of 3 1 2 3

Moderated by  R. Belmont 

Who's Online Now
4 registered members (Edstrom, Dorando, B2K24, 1 invisible), 34 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,564
Posts111,885
Members4,805
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.037s Queries: 14 (0.009s) Memory: 5.7292 MB (Peak: 5.9470 MB) Zlib enabled. Server Time: 2018-08-15 18:38:30 UTC