Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-12-04 18:46:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
72fa33d9fb5bdfd6dce84a8d00f61fcf2ab63765
72fa33d9
1 parent
f1192a83
update performance to 4k, when mr_sleep to 2000ms. 2.0.52
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
12 行增加
和
5 行删除
README.md
trunk/src/rtmp/srs_protocol_buffer.cpp
README.md
查看文件 @
72fa33d
...
...
@@ -738,6 +738,7 @@ The publish benchmark by [st-load](https://github.com/winlinvip/st-load):
*
2014-12-04, SRS 2.0.49, 1.4k(1400) publishers, 68%CPU, 144MB.
*
2014-12-04, SRS 2.0.49, 2.5k(2500) publishers, 95%CPU, 404MB.
[
commit
](
https://github.com/winlinvip/simple-rtmp-server/commit/29324fab469e0f7cef9ad04ffdbce832ac7dd9ff
)
*
2014-12-04, SRS 2.0.51, 2.5k(2500) publishers, 91%CPU, 259MB.
[
commit
](
https://github.com/winlinvip/simple-rtmp-server/commit/f57801eb46c16755b173984b915a4166922df6a6
)
*
2014-12-04, SRS 2.0.52, 4.0k(4000) publishers, 80%CPU, 331MB. (mr_sleep=2000)
[
commit
](
https://github.com/winlinvip/simple-rtmp-server/commit/5589b13d2e216b91f97afb78ee0c011b2fccf7da
)
## Architecture
...
...
trunk/src/rtmp/srs_protocol_buffer.cpp
查看文件 @
72fa33d
...
...
@@ -165,17 +165,23 @@ int SrsFastBuffer::grow(ISrsBufferReader* reader, int required_size)
}
// when read payload and need to grow, reset buffer.
if
(
end
-
p
<
required_size
&&
required_size
>
SRS_RTMP_MAX_MESSAGE_HEADER
)
{
// or there is no space to read.
int
max_to_read
=
buffer
+
nb_buffer
-
end
;
if
(
end
-
p
<
required_size
&&
(
required_size
>
SRS_RTMP_MAX_MESSAGE_HEADER
||
max_to_read
<
required_size
)
)
{
int
nb_cap
=
end
-
p
;
srs_verbose
(
"move fast buffer %d bytes"
,
nb_cap
);
buffer
=
(
char
*
)
memmove
(
buffer
,
p
,
nb_cap
);
p
=
buffer
;
end
=
p
+
nb_cap
;
if
(
nb_cap
<
nb_buffer
)
{
buffer
=
(
char
*
)
memmove
(
buffer
,
p
,
nb_cap
);
p
=
buffer
;
end
=
p
+
nb_cap
;
}
}
while
(
end
-
p
<
required_size
)
{
// the max to read is the left bytes.
size_t
max_to_read
=
buffer
+
nb_buffer
-
end
;
max_to_read
=
buffer
+
nb_buffer
-
end
;
if
(
max_to_read
<=
0
)
{
ret
=
ERROR_RTMP_BUFFER_OVERFLOW
;
...
...
请
注册
或
登录
后发表评论