mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 08:17:35 +02:00
More revisions
This commit is contained in:
parent
2cd0374d24
commit
54386c444a
1 changed files with 5 additions and 3 deletions
|
@ -14,14 +14,16 @@ Initial speed test for `tail` - Cyclone does very poorly compared to other Schem
|
||||||
user 0m31.783s
|
user 0m31.783s
|
||||||
sys 0m0.513s
|
sys 0m0.513s
|
||||||
|
|
||||||
One of the easiest things to do is run a profiler on the code. This lets us see if there is something in the runtime or compiled code that is dominating the runtime, and possibly slowing things down. This isn't a catch-all - for example, it can't show us if a compiler optimization is needed. But it helps paint a picture of what is going on.
|
One of the easiest things to do is run a profiler on the code to figure out what is going on. This lets us see if there is something in the runtime or compiled code that is dominating the runtime, and possibly slowing things down. This isn't a catch-all - for example, it can't show us if a compiler optimization is needed. But it helps paint a picture of what is going on.
|
||||||
|
|
||||||
|
A compiled Cyclone program is just a regular C program so we can use the standard GNU tools for profiling and debugging.
|
||||||
|
|
||||||
To get started we change `Makefile.config` in cyclone-bootstrap to enable profiling. The `-O2` option in the lines below are replaced with `-g -pg`:
|
To get started we change `Makefile.config` in cyclone-bootstrap to enable profiling. The `-O2` option in the lines below are replaced with `-g -pg`:
|
||||||
|
|
||||||
CFLAGS ?= -g -pg -fPIC -rdynamic -Wall -Iinclude -L.
|
CFLAGS ?= -g -pg -fPIC -rdynamic -Wall -Iinclude -L.
|
||||||
COMP_CFLAGS ?= -g -pg -fPIC -rdynamic -Wall -I$(PREFIX)/include -L$(PREFIX)/lib
|
COMP_CFLAGS ?= -g -pg -fPIC -rdynamic -Wall -I$(PREFIX)/include -L$(PREFIX)/lib
|
||||||
|
|
||||||
Then Cyclone is rebuilt:
|
Then Cyclone must be rebuilt:
|
||||||
|
|
||||||
[justin@justin-pc cyclone-bootstrap]$ sudo make clean ; ./install.sh
|
[justin@justin-pc cyclone-bootstrap]$ sudo make clean ; ./install.sh
|
||||||
|
|
||||||
|
@ -69,7 +71,7 @@ Let's examine the start of `report.txt` to see the functions that are taking up
|
||||||
|
|
||||||
Well that's interesting, `tail` is spending all of its time computing `Cyc_length`.
|
Well that's interesting, `tail` is spending all of its time computing `Cyc_length`.
|
||||||
|
|
||||||
A compiled Cyclone program is just a regular C program so we can use `gdb` to debug it and figure out how `Cyc_length` is being called.
|
Again, Cyclone compiles programs to C, so we can use `gdb` to debug them and figure out how `Cyc_length` is being called.
|
||||||
|
|
||||||
First we need to know what inputs to use:
|
First we need to know what inputs to use:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue