Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
deno
提交
f2447f6a
D
deno
项目概览
张重言
/
deno
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
deno
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f2447f6a
编写于
12月 08, 2018
作者:
K
Kevin (Kun) "Kassimo" Qian
提交者:
Ryan Dahl
12月 08, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add more profiling and debugging guides
上级
be2e5cce
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
59 addition
and
4 deletion
+59
-4
Docs.md
Docs.md
+59
-4
未找到文件。
Docs.md
浏览文件 @
f2447f6a
...
...
@@ -230,6 +230,8 @@ are a few particularly useful ones:
## How to Profile deno
To start profiling,
```
sh
# Make sure we're only building release.
export
DENO_BUILD_MODE
=
release
...
...
@@ -240,11 +242,64 @@ export DENO_BUILD_MODE=release
# Exercise it.
third_party/wrk/linux/wrk http://localhost:4500/
kill
`
pgrep deno
`
# When supplying --prof, V8 will write a file in the current directory that
# looks like this isolate-0x7fad98242400-v8.log
# To examine this file:
```
V8 will write a file in the current directory that looks like this:
`isolate-0x7fad98242400-v8.log`
. To examine this file:
```
sh
D8_PATH
=
target/release/ ./third_party/v8/tools/linux-tick-processor
isolate-0x7fad98242400-v8.log
>
prof.log
# on macOS, use ./third_party/v8/tools/mac-tick-processor instead
```
`prof.log`
will contain information about tick distribution of different calls.
To view the log with Web UI, generate JSON file of the log:
```
sh
D8_PATH
=
target/release/ ./third_party/v8/tools/linux-tick-processor
isolate-0x7fad98242400-v8.log
isolate-0x7fad98242400-v8.log
--preprocess
>
prof.json
```
Open
`third_party/v8/tools/profview/index.html`
in your brower, and select
`prof.json`
to view the distribution graphically.
To learn more about
`d8`
and profiling, check out the following links:
-
[
https://v8.dev/docs/d8
](
https://v8.dev/docs/d8
)
-
[
https://v8.dev/docs/profile
](
https://v8.dev/docs/profile
)
## How to Debug deno
We can use LLDB to debug deno.
```
sh
lldb
--
target/debug/deno tests/worker.js
>
run
>
bt
>
up
>
up
>
l
```
To debug Rust code, we can use
`rust-lldb`
. It should come with
`rustc`
and is a
wrapper around LLDB.
```
sh
rust-lldb
--
./target/debug/deno tests/http_bench.ts
--allow-net
# On macOS, you might get warnings like
# `ImportError: cannot import name _remove_dead_weakref`
# In that case, use system python by setting PATH, e.g.
# PATH=/System/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH
(
lldb
)
command
script import
"/Users/kevinqian/.rustup/toolchains/1.30.0-x86_64-apple-darwin/lib/rustlib/etc/lldb_rust_formatters.py"
(
lldb
)
type
summary add
--no-value
--python-function
lldb_rust_formatters.print_val
-x
".*"
--category
Rust
(
lldb
)
type
category
enable
Rust
(
lldb
)
target create
"../deno/target/debug/deno"
Current executable
set
to
'../deno/target/debug/deno'
(
x86_64
)
.
(
lldb
)
settings
set
--
target.run-args
"tests/http_bench.ts"
"--allow-net"
(
lldb
)
b op_start
(
lldb
)
r
```
## Build Instructions _(for advanced users only)_
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录