On Feb 17, 2014, at 10:23 AM, Vincent St-Amour <stamo...@ccs.neu.edu> wrote:
> At Sun, 16 Feb 2014 23:43:30 -0500, > Bloch Stephen wrote: >> The results so far: the typed version is taking 20-30 times longer >> than the untyped version. Huh? > > Are you measuring the time from an untyped driver module, or from within > Typed Racket? If you're, for example, constructing matrices on the > untyped side, and passing them to the typed side, every matrix access > will trigger contract checking (to protect the typed module's invariants > from invalid inputs from the untyped side), which can have a significant > cost. No, the definitions and the benchmarks are all in one typed/racket source file, run from the command line with “racket typed-matops.rkt”. > You can try using the contract profiler (`(require contract-profile)' in > post-5.3.6 Racket) to see whether contracts are the problem. If so, you > can try moving more code from untyped to typed to avoid contracts. > > >> I've installed the optimization coach, and am looking through its >> recommendations. For the untyped version, it suggested a couple of >> inlinings. For the typed version, nothing. > > Does the optimization coach confirm that optimizations are happening in > the typed version? Many segments of code are highlighted in green, if that’s what you mean. A few are pink, but they’re not the ones being timed (e.g. the function that builds a random square matrix of a given size, to be handed to all three multiplication algorithms). > As Matthias said, if you can share your code, I'd be happy to have a > look. Sure. That may take a few hours: I have to run off to class now. Stephen Bloch sbl...@adelphi.edu
signature.asc
Description: Message signed with OpenPGP using GPGMail
____________________ Racket Users list: http://lists.racket-lang.org/users