是否有任何隐藏的选项将成本中心放入图书馆?目前我已经设置了这样的分析:
ghc-prof-options: -O2
-threaded
-fexcess-precision
-fprof-auto
-rtsopts
"-with-rtsopts=-N -p -s -h -i0.1"
Run Code Online (Sandbox Code Playgroud)
# cabal sandbox init
# cabal install --enable-library-profiling --enable-executable-profiling
# cabal configure --enable-library-profiling --enable-executable-profiling
# cabal run
Run Code Online (Sandbox Code Playgroud)
这可以在程序完成时创建预期的.prof文件,.hp文件和摘要.
问题是该.prof文件不包含任何不属于当前项目的内容.我的猜测是,可能有一个选项可以将成本中心放在外部库代码中?
\n\n\n我的猜测是,可能有一个选项可以将成本中心放入外部库代码中?
\n
嗯,不是默认的。编译依赖项时需要添加成本中心。但是,您可以在以下期间添加-fprof-auto选项:ghccabal install
\n$ cabal 沙箱初始化\n$ cabal install --ghc-option=-fprof-auto -p --enable-executable-profiling\n\n\n
使用此问题中的代码的示例,其中问题中的代码包含在 SO.hs 中:
\n\n\n$ cabal 沙箱初始化\n$ cabal install vector -p --ghc-options=-fprof-auto\n$ cabal exec -- ghc --make SO.hs -prof -fprof-auto -O2\n$ 。 /SO /usr/share/dict/words +RTS -s -p\n$ cat SO.prof\n 2014 年 12 月 2 日星期二 15:01 时间和分配分析报告(最终)\n\n 测试 +RTS -s - p -RTS /usr/share/dict/words\n\n 总时间 = 0.70 秒(698 个时钟周期 @ 1000 us,1 个处理器)\n 总分配 = 618,372,952 字节(不包括分析开销)\n\nCOST CENTER MODULE %time %alloc\n\nletterCount Main 40.3 24.3\nletterCount.letters1 Main 13.2 18.2\nbasicUnsafeWrite Data.Vector.Primitive.Mutable 10.0 12.1\nbasicUnsafeWrite Data.Vector.Unboxed.Base 7.2 7.3\nbasicUnsafeRead Data.Vector.Primitive.Mutable 5.4 4.9\ n>>= Data.Vector.Fusion.Util 5.0 13.4\nbasicUnsafeIndexM Data.Vector.Unboxed.Base 4.9 0.0\nbasicUnsafeIndexM Data.Vector.Primitive 2.7 4.9\nbasicUnsafeIndexM Data.Vector.Unboxed.Base 2.3 0.0\nletterCount.letters1。\ \ Main 2.0 2.4\n>>= Data.Vector.Fusion.Util 1.9 6.1\nbasicUnsafeWrite Data.Vector.Unboxed.Base 1.7 0.0\nletterCount.\\ Main 1.3 2.4\nreadByteArray# Data.Primitive.Types 0.3 2.4\nbasicUnsafeNew 数据.Vector.Primitive.Mutable 0.0 1.2\n\n\n 个人继承\n成本中心模块编号 条目 %time %alloc %time %alloc\n\nMAIN MAIN 72 0 0.0 0.0 100.0 100.0\n main Main 145 0 0.1 0.2 99.9 100.0\n main.counts Main 148 1 0.0 0.0 99.3 99.6\n letterCount Main 149 1 40.3 24.3 99.3 99.6 \ n BASICUNSAFEFEEFREEZE数据。 \\主要 256 938848 1.3 2.4 1.3 2.4\n basicUnsafeWrite Data.Vector.Unboxed.Base 252 938848 1.3 0.0 5.0 6.1\n basicUnsafeWrite Data.Vector.Primitive.Mutable 253 938848 3.7 6.1 3.7 6.1\n writeByteArray # Data.Primitive.Types 255 938848 0.0 0.0 0.0 0.0\n 原始 Control.Monad。\n\n
不幸的是,您不能--ghc-option=\xe2\x80\xa6在依赖项中声明为标志。
| 归档时间: |
|
| 查看次数: |
443 次 |
| 最近记录: |