Skip to content

Commit

Permalink
For #1509, decrease the fast vector init size from 64KB to 64B. 3.0.99
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 15, 2020
1 parent 857c783 commit 7240fe3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 31 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ For previous versions, please read:

## V3 changes

* v3.0, 2020-01-15, For [#1509][bug #1509], decrease the fast vector init size from 64KB to 64B. 3.0.99
* v3.0, 2020-01-15, For [#1509][bug #1509], release coroutine when source is idle. 3.0.98
* <strong>v3.0, 2020-01-10, [3.0 alpha8(3.0.97)][r3.0a8] released. 121555 lines.</strong>
* v3.0, 2020-01-09, For [#1042][bug #1042], improve test coverage for service. 3.0.97
Expand Down
20 changes: 4 additions & 16 deletions trunk/auto/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Options:
--with-research build the research tools.
--with-utest build the utest for SRS.
--with-gperf build SRS with gperf tools(no gmd/gmc/gmp/gcp, with tcmalloc only).
https://blog.csdn.net/win_lin/article/details/53503869
--with-gmc build memory check for SRS with gperf tools.
--with-gmd build memory defense(corrupt memory) for SRS with gperf tools.
--with-gmp build memory profile for SRS with gperf tools.
Expand Down Expand Up @@ -198,6 +199,7 @@ Experts:
--memory-watch enable memory watch to detect memory leaking(hurts performance).
--export-librtmp-project=<path> export srs-librtmp to specified project in path.
--export-librtmp-single=<path> export srs-librtmp to a single file(.h+.cpp) in path.
--with-valgrind support valgrind for memory check.
--without-valgrind donot support valgrind for memory check.
Workflow:
Expand All @@ -207,10 +209,7 @@ Workflow:
4. generate detail features.
Remark:
1. both ubuntu12 and ubuntu14 are ok for SRS.
2. the centos5, centos6 and centos7 are ok for SRS.
3. all linux and unix-like os are ok for SRS.
4. windows is absolutely impossible for SRS.
1. For performance improving, read https://blog.csdn.net/win_lin/article/details/53503869
END
}
Expand Down Expand Up @@ -289,6 +288,7 @@ function parse_user_option() {
--memory-watch) SRS_MEM_WATCH=YES ;;
--export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;;
--export-librtmp-single) SRS_EXPORT_LIBRTMP_SINGLE=${value} ;;
--with-valgrind) SRS_VALGRIND=YES ;;
--without-valgrind) SRS_VALGRIND=NO ;;

--with-http-callback) SRS_HTTP_CALLBACK=YES ;;
Expand Down Expand Up @@ -395,18 +395,6 @@ function apply_user_presets() {
SRS_STATIC=NO
fi

# for osx(darwin)
if [ $SRS_OSX = YES ]; then
SRS_HDS=YES
SRS_LIBRTMP=YES
SRS_RESEARCH=NO
SRS_UTEST=YES
SRS_STATIC=NO
# valgrind is not supported by macOS sierra, read
# https://stackoverflow.com/questions/40650338/valgrind-on-macos-sierra
SRS_VALGRIND=NO
fi

# if dev specified, open features if possible.
if [ $SRS_DEV = YES ]; then
SRS_HDS=YES
Expand Down
5 changes: 1 addition & 4 deletions trunk/auto/summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ echo -e " \${BLACK}+--------------------------------------------------------
echo -e " |\${GREEN}The main server usage: ./objs/srs -c conf/srs.conf, start the srs server\${BLACK}"
echo -e " | ${SrsHlsSummaryColor}About HLS, please read https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS\${BLACK}"
echo -e " | ${SrsDvrSummaryColor}About DVR, please read https://github.com/ossrs/srs/wiki/v3_CN_DVR\${BLACK}"
echo -e " | ${SrsNginxSummaryColor}About NGINX, please read https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS\${BLACK}"
echo -e " | ${SrsSslSummaryColor}About SSL, please read https://github.com/ossrs/srs/wiki/v1_CN_RTMPHandshake\${BLACK}"
echo -e " | ${SrsFfmpegSummaryColor}About FFMPEG, please read https://github.com/ossrs/srs/wiki/v3_CN_FFMPEG\${BLACK}"
echo -e " | ${SrsTranscodeSummaryColor}About transcoding, please read https://github.com/ossrs/srs/wiki/v3_CN_FFMPEG\${BLACK}"
echo -e " | ${SrsIngestSummaryColor}About ingester, please read https://github.com/ossrs/srs/wiki/v1_CN_Ingest\${BLACK}"
echo -e " | ${SrsHttpCallbackSummaryColor}About http-callback, please read https://github.com/ossrs/srs/wiki/v3_CN_HTTPCallback\${BLACK}"
echo -e " | ${SrsHttpServerSummaryColor}Aoubt embeded http-server, please read https://github.com/ossrs/srs/wiki/v2_CN_HTTPServer\${BLACK}"
echo -e " | ${SrsHttpServerSummaryColor}Aoubt http-server, please read https://github.com/ossrs/srs/wiki/v2_CN_HTTPServer\${BLACK}"
echo -e " | ${SrsHttpApiSummaryColor}About http-api, please read https://github.com/ossrs/srs/wiki/v3_CN_HTTPApi\${BLACK}"
echo -e " | ${SrsStreamCasterSummaryColor}About stream-caster, please read https://github.com/ossrs/srs/wiki/v2_CN_Streamer\${BLACK}"
echo -e " | ${SrsKafkaSummaryColor}About kafka, please read https://github.com/ossrs/srs/wiki/v3_CN_Kafka\${BLACK}"
echo -e " | ${SrsValgrindSummaryColor}About VALGRIND, please read https://github.com/ossrs/state-threads/issues/2\${BLACK}"
echo -e " \${BLACK}+------------------------------------------------------------------------------------\${BLACK}"
echo -e "\${GREEN}binaries, please read https://github.com/ossrs/srs/wiki/v2_CN_Build\${BLACK}"
Expand Down
8 changes: 4 additions & 4 deletions trunk/src/app/srs_app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6771,22 +6771,22 @@ string SrsConfig::get_vhost_http_dir(string vhost)
bool SrsConfig::get_vhost_http_remux_enabled(string vhost)
{
static bool DEFAULT = false;

SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return DEFAULT;
}

conf = conf->get("http_remux");
if (!conf) {
return DEFAULT;
}

conf = conf->get("enabled");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}

return SRS_CONF_PERFER_FALSE(conf->arg0());
}

Expand Down
8 changes: 4 additions & 4 deletions trunk/src/app/srs_app_http_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandle
if (it == tflvs.end()) {
return err;
}

// hstrs always enabled.
// for origin, the http stream will be mount already when publish,
// so it must never enter this line for stream already mounted.
Expand Down Expand Up @@ -1064,7 +1064,7 @@ srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandle
if (srs_string_count(upath, "/") != srs_string_count(entry->mount, "/")) {
return err;
}

// convert to concreate class.
SrsHttpMessage* hreq = dynamic_cast<SrsHttpMessage*>(request);
srs_assert(hreq);
Expand Down Expand Up @@ -1127,7 +1127,7 @@ srs_error_t SrsHttpStreamServer::initialize_flv_streaming()
if (!conf->is_vhost()) {
continue;
}

if ((err = initialize_flv_entry(conf->arg0())) != srs_success) {
return srs_error_wrap(err, "init flv entries");
}
Expand All @@ -1139,7 +1139,7 @@ srs_error_t SrsHttpStreamServer::initialize_flv_streaming()
srs_error_t SrsHttpStreamServer::initialize_flv_entry(std::string vhost)
{
srs_error_t err = srs_success;

if (!_srs_config->get_vhost_http_remux_enabled(vhost)) {
return err;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/src/app/srs_app_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int64_t SrsRtmpJitter::get_time()
SrsFastVector::SrsFastVector()
{
count = 0;
nb_msgs = SRS_PERF_MW_MSGS * 8;
nb_msgs = 8;
msgs = new SrsSharedPtrMessage*[nb_msgs];
}

Expand Down Expand Up @@ -212,7 +212,7 @@ void SrsFastVector::push_back(SrsSharedPtrMessage* msg)
{
// increase vector.
if (count >= nb_msgs) {
int size = nb_msgs * 2;
int size = srs_max(SRS_PERF_MW_MSGS * 8, nb_msgs * 2);
SrsSharedPtrMessage** buf = new SrsSharedPtrMessage*[size];
for (int i = 0; i < nb_msgs; i++) {
buf[i] = msgs[i];
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// The version config.
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define VERSION_REVISION 98
#define VERSION_REVISION 99

// The macros generated by configure script.
#include <srs_auto_headers.hpp>
Expand Down

0 comments on commit 7240fe3

Please sign in to comment.