提交 dedd7c97 编写于 作者: H hjdhnx

接口性能性能代码优化,提升3200/10ms性能

上级 e3c56027
3.9.29beta2 3.9.29beta3
\ No newline at end of file \ No newline at end of file
...@@ -54,7 +54,7 @@ function pre(){ ...@@ -54,7 +54,7 @@ function pre(){
} }
let rule = {}; let rule = {};
const VERSION = 'drpy1 3.9.29 20221204'; const VERSION = 'drpy1 3.9.29beta3 20221204';
/** 已知问题记录 /** 已知问题记录
* 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了] * 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了]
* Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下) * Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下)
...@@ -1926,15 +1926,19 @@ function detailParse(detailObj){ ...@@ -1926,15 +1926,19 @@ function detailParse(detailObj){
// 此处存在性能问题: pt版2000集需要650毫秒,俊版1300毫秒 特么的优化不动 主要后面定位url的我拿他没法 // 此处存在性能问题: pt版2000集需要650毫秒,俊版1300毫秒 特么的优化不动 主要后面定位url的我拿他没法
// 主要性能问题在于 _pd(it, list_url, MY_URL) // 主要性能问题在于 _pd(it, list_url, MY_URL)
let tt1 = (new Date()).getTime(); let tt1 = (new Date()).getTime();
vodList.forEach((it,idex)=>{ // vodList.forEach((it,idex)=>{
// 请注意,这里要固定pdfh解析body&&Text,不需要下划线,没写错 // // 请注意,这里要固定pdfh解析body&&Text,不需要下划线,没写错
// new_vod_list.push(pdfh(it,'body&&Text')+'$'+_pd(it,'a&&href',MY_URL)); // // new_vod_list.push(pdfh(it,'body&&Text')+'$'+_pd(it,'a&&href',MY_URL));
// new_vod_list.push(cheerio.load(it).text()+'$'+_pd(it,'a&&href',MY_URL)); // // new_vod_list.push(cheerio.load(it).text()+'$'+_pd(it,'a&&href',MY_URL));
// new_vod_list.push(_pdfh(it, list_text).trim() + '$' + _pd(it, list_url, MY_URL)); // // new_vod_list.push(_pdfh(it, list_text).trim() + '$' + _pd(it, list_url, MY_URL));
// new_vod_list.push(_pdfh(it, list_text).trim() + '$' +idex); // // new_vod_list.push(_pdfh(it, list_text).trim() + '$' +idex);
// new_vod_list.push(idex + '$' +_pdfh(it, list_url)); // // new_vod_list.push(idex + '$' +_pdfh(it, list_url));
// new_vod_list.push(_pdfh(it, list_text).trim() + '$' +_pd(it, list_url,MY_URL));
// });
for(let i=0;i<vodList.length;i++){
let it = vodList[i];
new_vod_list.push(_pdfh(it, list_text).trim() + '$' +_pd(it, list_url,MY_URL)); new_vod_list.push(_pdfh(it, list_text).trim() + '$' +_pd(it, list_url,MY_URL));
}); }
if(vodList.length>0){ if(vodList.length>0){
new_vod_list = forceOrder(new_vod_list,'',x=>x.split('$')[0]); new_vod_list = forceOrder(new_vod_list,'',x=>x.split('$')[0]);
console.log(`drpy影响性能代码共计列表数循环次数:${vodList.length},耗时:${(new Date()).getTime()-tt1}毫秒`); console.log(`drpy影响性能代码共计列表数循环次数:${vodList.length},耗时:${(new Date()).getTime()-tt1}毫秒`);
......
此差异已折叠。
...@@ -34,7 +34,7 @@ function pre(){ ...@@ -34,7 +34,7 @@ function pre(){
} }
let rule = {}; let rule = {};
const VERSION = 'drpy2 3.9.29 20221204'; const VERSION = 'drpy2 3.9.29beta3 20221204';
/** 已知问题记录 /** 已知问题记录
* 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了] * 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了]
* Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下) * Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下)
...@@ -1792,15 +1792,19 @@ function detailParse(detailObj){ ...@@ -1792,15 +1792,19 @@ function detailParse(detailObj){
// 此处存在性能问题: pt版2000集需要650毫秒,俊版1300毫秒 特么的优化不动 主要后面定位url的我拿他没法 // 此处存在性能问题: pt版2000集需要650毫秒,俊版1300毫秒 特么的优化不动 主要后面定位url的我拿他没法
// 主要性能问题在于 _pd(it, list_url, MY_URL) // 主要性能问题在于 _pd(it, list_url, MY_URL)
let tt1 = (new Date()).getTime(); let tt1 = (new Date()).getTime();
vodList.forEach((it,idex)=>{ // vodList.forEach((it,idex)=>{
// 请注意,这里要固定pdfh解析body&&Text,不需要下划线,没写错 // // 请注意,这里要固定pdfh解析body&&Text,不需要下划线,没写错
// new_vod_list.push(pdfh(it,'body&&Text')+'$'+_pd(it,'a&&href',MY_URL)); // // new_vod_list.push(pdfh(it,'body&&Text')+'$'+_pd(it,'a&&href',MY_URL));
// new_vod_list.push(cheerio.load(it).text()+'$'+_pd(it,'a&&href',MY_URL)); // // new_vod_list.push(cheerio.load(it).text()+'$'+_pd(it,'a&&href',MY_URL));
// new_vod_list.push(_pdfh(it, list_text).trim() + '$' + _pd(it, list_url, MY_URL)); // // new_vod_list.push(_pdfh(it, list_text).trim() + '$' + _pd(it, list_url, MY_URL));
// new_vod_list.push(_pdfh(it, list_text).trim() + '$' +idex); // // new_vod_list.push(_pdfh(it, list_text).trim() + '$' +idex);
// new_vod_list.push(idex + '$' +_pdfh(it, list_url)); // // new_vod_list.push(idex + '$' +_pdfh(it, list_url));
// new_vod_list.push(_pdfh(it, list_text).trim() + '$' +_pd(it, list_url,MY_URL));
// });
for(let i=0;i<vodList.length;i++){
let it = vodList[i];
new_vod_list.push(_pdfh(it, list_text).trim() + '$' +_pd(it, list_url,MY_URL)); new_vod_list.push(_pdfh(it, list_text).trim() + '$' +_pd(it, list_url,MY_URL));
}); }
if(vodList.length>0){ if(vodList.length>0){
new_vod_list = forceOrder(new_vod_list,'',x=>x.split('$')[0]); new_vod_list = forceOrder(new_vod_list,'',x=>x.split('$')[0]);
console.log(`drpy影响性能代码共计列表数循环次数:${vodList.length},耗时:${(new Date()).getTime()-tt1}毫秒`); console.log(`drpy影响性能代码共计列表数循环次数:${vodList.length},耗时:${(new Date()).getTime()-tt1}毫秒`);
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册