Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Function Inlining
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-08-01 (21:23)
From: Jonathan Bryant <jtbryant@v...>
Subject: Function Inlining
What is the deal with the -inline option for ocamlopt?  I've turned it
off (0), turned it on (1), turned it up (10 - 100) and gone crazy
(10000) with it.  Yet my executable says exactly the same size and runs
in exactly the same time.  I know inlining functions leads to code
bloating and (usually) performance increases, so I'm confused.  Is it
not working?  I have both large and small functions so it's not that
they are all getting inlined any time it is on.  Besides turning it off
makes no difference.

What's going on here?

| Jonathan Bryant       |^|
| | |
| AIM: JonBoy3182       | |
| (229) 834-4400        | |

"If the colleges were better, if they really had it, you would need to
get the police at the gates to keep order in the inrushing multitude.
See in college how we thwart the natural love of learning by leaving the
natural method of teaching what each wishes to learn, and insisting that
you shall learn what you have no taste or capacity for. The college,
which should be a place of delightful labour, is made odious and
unhealthy, and the young men are tempted to frivolous amusements to
rally their jaded spirits. I would have the studies elective.
Scholarship is to be created not by compulsion, but by awakening a pure
interest in knowledge. The wise instructor accomplishes this by opening
to his pupils precisely the attractions the study has for himself. The
marking is a system for schools, not for the college; for boys, not for
men; and it is an ungracious work to put on a professor."
-- Ralph Waldo Emerson