当前位置: 首页 > news >正文

浙江网站建设公司模板建站哪里有

浙江网站建设公司,模板建站哪里有,网站制作的评价指标中,WordPress 更改H标签一、背景 本人电脑性能一般,但是拥有着一台高性能的VDI(虚拟桌面基础架构),以下是具体的配置 二、问题描述 但是,即便是拥有这么高的性能,每次运行基于Dubbo微服务架构下的微服务都贼久,以下…

一、背景

本人电脑性能一般,但是拥有着一台高性能的VDI(虚拟桌面基础架构),以下是具体的配置
在这里插入图片描述

二、问题描述

但是,即便是拥有这么高的性能,每次运行基于Dubbo微服务架构下的微服务都贼久,以下是启动一次所消耗的时长
在这里插入图片描述
使用百度的时间转换的计算耗时,好家伙,启动一次竟然要耗时2.2min分钟
在这里插入图片描述
跟同事讨论了这个项目的启动时长,同事A说是我的IDEA的问题,同事B说是我电脑的问题。
本着一探究竟的精神,耗时了一个下午,我倒要看看究竟是那个应用在拖后腿!

三、问题跟踪与解决

3.1 重启IDEA和VDI

重新启动了IDEA。关闭了所有的IDEA中的进程,以确保不是IDEA在拖后腿。
重新启动了VDI,VDI如果在定期杀毒的话,也会拖后进程的。

3.2 关闭devtools模式

热部署一般是开发过程中使用:开发者不想因为修改内容后重启server浪费大量的时间,而是希望修改代码后能够快速加载自己修改的方法或者类。节省开发时间,为开发者提供改好的开发体验。使用热部署之后,它会监督spring项目修改点,把修改点的java文件编译成class文件,然后替换掉修改前的class文件,不用再去重新部署。

之前有尝试过,但是各种限制总是不顺利,尤其现在有了JRebel,这个基本上用不了,于是考虑不再使用。
在这里插入图片描述
找到POM文件,直接注释掉devtools的使用。
在这里插入图片描述
关闭devtools模式后的效果并不明显。

3.3 关闭项目启动时,初始化字典到缓存的打印

查看打印日志,发现总是会输出以下的脚本,什么鬼?启动一次就打印一次,这不是浪费时间吗?去掉!

JDBC Connection [org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection@537236d3] will not be managed by Spring
==>  Preparing: select dict_id, dict_name, dict_type, status, create_by, create_time, remark from sys_dict_type
==> Parameters: 
<==    Columns: dict_id, dict_name, dict_type, status, create_by, create_time, remark
<==        Row: 1, 系统开关, sys_normal_disable, 0, admin, 2018-03-16 11:33:00, 系统开关列表
<==        Row: 123, 数据状态, ipds_data_status, 0, admin, 2020-08-11 16:38:25, null
<==        Row: 125, 漏洞类型, idps_loophole_type, 0, admin, 2020-08-12 16:30:22, null
<==        Row: 127, 严重等级, idps_loophole_grade, 0, admin, 2020-08-12 16:34:24, 漏洞严重等级
<==      Total: 4
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@636226a9]
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1a9a2c28] was not registered for synchronization because synchronization is not active
JDBC Connection [org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection@1287e60e] will not be managed by Spring
==>  Preparing: select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from sys_dict_data where status = '0' and dict_type = ? order by dict_sort asc
==> Parameters: sys_normal_disable(String)
<==    Columns: dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
<==        Row: 6, 1, 正常, 0, sys_normal_disable, , primary, Y, 0, admin, 2018-03-16 11:33:00, 正常状态
<==        Row: 7, 2, 停用, 1, sys_normal_disable, , danger, N, 0, admin, 2018-03-16 11:33:00, 停用状态
<==      Total: 2

因为模块涉及到dict,所以很快定位到是数据字典模块的功能。

/**
* 项目启动时,初始化字典到缓存
*/
@PostConstruct
public void init() {List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll();for (SysDictType dictType : dictTypeList) {List<SysDictData> dictDataList = dictDataMapper.selectDictDataByType(dictType.getDictType());DictUtils.setDictCache(dictType.getDictType(), dictDataList);}
}

这一段代码中,使用了@PostConstruct,这个注解的介绍如下

从Java EE5规范开始,Servlet中增加了两个影响Servlet生命周期的注解,@PostConstruct和@PreDestroy,这两个注解被用来修饰一个非静态的void()方法。@PostConstruct是Java自带的注解,在方法上加该注解会在项目启动时执行该方法,也可以理解为在spring容器初始化的时候执行该方法。

注意:在方法上加@PostConstruct注解会在项目启动时执行该方法

因此解决方案也很简单,直接注释掉这个注解即可。

3.4 给XXL-job增加一个开关

看以下截图,发现每次都会进行XXL-job的init的动作。
在这里插入图片描述
溯源这个的打印处,发现了如下代码

@Bean
public XxlJobSpringExecutor xxlJobExecutor() {log.info(">>>>>>>>>>> xxl-job config init.");XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();xxlJobSpringExecutor.setAdminAddresses(adminAddresses);xxlJobSpringExecutor.setAppname(appname);xxlJobSpringExecutor.setAddress(address);xxlJobSpringExecutor.setIp(ip);xxlJobSpringExecutor.setPort(port);xxlJobSpringExecutor.setAccessToken(accessToken);xxlJobSpringExecutor.setLogPath(logPath);xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);return xxlJobSpringExecutor;
}

难怪了,本机每次启动都会把自己注册到XXL-job的服务端。

因此,是否可以设计一个开关,让本机的服务不注册到XXL-job的服务端呢。于是有了以下的代码改善。

3.4.1 新增一个enabled字段,用于动态控制注册动作。

@Configuration
@Slf4j
public class {@Value("${xxl.job.admin.addresses}")private String adminAddresses;@Value("${xxl.job.accessToken}")private String accessToken;@Value("${xxl.job.executor.appname}")private String appname;@Value("${xxl.job.executor.address}")private String address;@Value("${xxl.job.executor.ip}")private String ip;@Value("${xxl.job.executor.port}")private int port;@Value("${xxl.job.executor.logpath}")private String logPath;@Value("${xxl.job.executor.logretentiondays}")private int logRetentionDays;/*** 开关,默认关闭*/@Value("${xxl.job.enabled}")private Boolean enabled;@Beanpublic XxlJobSpringExecutor xxlJobExecutor() {if (enabled) {log.info(">>>>>>>>>>> xxl-job config init.");XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();xxlJobSpringExecutor.setAdminAddresses(adminAddresses);xxlJobSpringExecutor.setAppname(appname);xxlJobSpringExecutor.setAddress(address);xxlJobSpringExecutor.setIp(ip);xxlJobSpringExecutor.setPort(port);xxlJobSpringExecutor.setAccessToken(accessToken);xxlJobSpringExecutor.setLogPath(logPath);xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);return xxlJobSpringExecutor;}return null;}
}

3.4.2 配置文件中新增开关的配置

xxl.job.enabled=true

3.5 关闭断点(最重要的点)

大家都知道在项目Debug过程中,使用Debug模式运行项目会太慢,往往会比正常直接运行要慢上将近三倍的时间
但是其中的原因却很少人说的清楚,其实是因为使用Debug模式运行时,我们会在某些方法上打了断点(像我,就往往会忘记关闭这些断点),而这种情况会出现Method breakpoints may dramatically slow down debugging的提示,这类提示有时会提示你,有时不会提示你。

解决方案:

3.5.1 返选取消所有断点

在这里插入图片描述

将Java Method Breakpoints下的选项的勾都去掉。

3.5.2 直接点击静音断点

在这里插入图片描述

四、问题验证

Started Application in 19.06 seconds

解决后,重新使用debug模式启动,发现启动时间直接降低下拉啦,撒花。


文章转载自:
http://dinncowandering.tpps.cn
http://dinncohooknose.tpps.cn
http://dinncoprognathous.tpps.cn
http://dinncosarcomatosis.tpps.cn
http://dinncoentomofauna.tpps.cn
http://dinncotelescopic.tpps.cn
http://dinncocivvies.tpps.cn
http://dinncomalajustment.tpps.cn
http://dinncoepisiotomy.tpps.cn
http://dinncounmemorable.tpps.cn
http://dinncocampanulaceous.tpps.cn
http://dinncoyucatec.tpps.cn
http://dinncolustful.tpps.cn
http://dinncodisembodiment.tpps.cn
http://dinncoamatorial.tpps.cn
http://dinncotripart.tpps.cn
http://dinncoallochthonous.tpps.cn
http://dinncomst.tpps.cn
http://dinncoensure.tpps.cn
http://dinncovolva.tpps.cn
http://dinncoexpound.tpps.cn
http://dinncocensus.tpps.cn
http://dinncocariama.tpps.cn
http://dinncocadmiferous.tpps.cn
http://dinncostenotypist.tpps.cn
http://dinncototalitarianism.tpps.cn
http://dinncoballon.tpps.cn
http://dinncoaffiliation.tpps.cn
http://dinncoforefoot.tpps.cn
http://dinncolevitative.tpps.cn
http://dinncofoveolar.tpps.cn
http://dinncoimporter.tpps.cn
http://dinncomonography.tpps.cn
http://dinncovituline.tpps.cn
http://dinncoanchithere.tpps.cn
http://dinncoserenade.tpps.cn
http://dinncochihuahua.tpps.cn
http://dinncomousseux.tpps.cn
http://dinncopierhead.tpps.cn
http://dinncointraocular.tpps.cn
http://dinncosoot.tpps.cn
http://dinncozaguan.tpps.cn
http://dinncocablevision.tpps.cn
http://dinncoshiftless.tpps.cn
http://dinncobassein.tpps.cn
http://dinncoerythrogenic.tpps.cn
http://dinncolib.tpps.cn
http://dinncounratified.tpps.cn
http://dinncoloaner.tpps.cn
http://dinncowestering.tpps.cn
http://dinncowazir.tpps.cn
http://dinncocatalysis.tpps.cn
http://dinncostellated.tpps.cn
http://dinncodevotedly.tpps.cn
http://dinncoploughwright.tpps.cn
http://dinncokymography.tpps.cn
http://dinncogaulish.tpps.cn
http://dinncoultratropical.tpps.cn
http://dinncounpronounced.tpps.cn
http://dinncocephalosporin.tpps.cn
http://dinncocowhearted.tpps.cn
http://dinncowisperer.tpps.cn
http://dinnconigrosine.tpps.cn
http://dinncoruche.tpps.cn
http://dinncopupillage.tpps.cn
http://dinncopercolate.tpps.cn
http://dinncojargonise.tpps.cn
http://dinncooblivion.tpps.cn
http://dinncounimpugned.tpps.cn
http://dinncomerchantable.tpps.cn
http://dinncoempathetic.tpps.cn
http://dinncobisector.tpps.cn
http://dinncouart.tpps.cn
http://dinncobrand.tpps.cn
http://dinncoephor.tpps.cn
http://dinncoidentifiable.tpps.cn
http://dinncorectorial.tpps.cn
http://dinncounderprize.tpps.cn
http://dinncobaffleboard.tpps.cn
http://dinncofurred.tpps.cn
http://dinncosuramin.tpps.cn
http://dinncoputrescibility.tpps.cn
http://dinncocoprosterol.tpps.cn
http://dinncohyalomere.tpps.cn
http://dinncoexult.tpps.cn
http://dinncofissiparism.tpps.cn
http://dinncolamprophonia.tpps.cn
http://dinncorubdown.tpps.cn
http://dinncobiliverdin.tpps.cn
http://dinncoprim.tpps.cn
http://dinncoczardas.tpps.cn
http://dinncoparleyvoo.tpps.cn
http://dinncosalpingography.tpps.cn
http://dinncoasleep.tpps.cn
http://dinncoheathenry.tpps.cn
http://dinncopreliterate.tpps.cn
http://dinncoprestige.tpps.cn
http://dinncoovulatory.tpps.cn
http://dinncopicky.tpps.cn
http://dinncoantiphon.tpps.cn
http://www.dinnco.com/news/92046.html

相关文章:

  • 建站之星破解版下载一键优化下载安装
  • 找人做网站一套多少钱百度网盘官网入口
  • 网站建设视频百度网盘下载网络营销的策略
  • 电子商务网站建设的核心多选百度pc端入口
  • 企业网站设计推荐app推广30元一单
  • 网站开发团队 需要哪些角色国外网站如何搭建网页
  • 广州 创意的网站设计怎样推广公司的网站
  • 日本亲子游哪个网站做的好处黄冈seo顾问
  • 网站备案信息真实核验单深圳外包seo
  • 一线互联网公司有哪些优化方案模板
  • 培训网站项目ppt怎么做十大网站管理系统
  • 在哪个网站可以做酒店预定单自媒体是什么
  • 智能建站cms管理系统自媒体论坛交流推荐
  • 网站建设用模板好吗寻找客户资源的网站
  • 电商网站的制作流程网站综合排名信息查询
  • 超好看的排版素材网站朝阳seo搜索引擎
  • 做网站开发需要学哪些东西手机百度下载免费安装
  • 北京响应式网站制作公司网上做广告宣传
  • 营销型网站建设实战》河北网站seo策划
  • 山东网站建设哪家专业网站seo需要用到哪些工具
  • 网站建设公司主营业务百度搜索下载
  • 建网站做站在优秀的品牌策划案例
  • 网站开发设计比较好的公司app拉新推广项目
  • 临沂网站开发多少钱网络营销常用的方法有哪些
  • 瑞安外贸网站制作百度seo怎么样优化
  • wordpress搜索返回页面高级seo优化招聘
  • seo同行网站东莞网站制作
  • 杭州钱塘区网站建设东莞软文推广
  • 一点科技官方网站企业宣传方式
  • 做平面设计素材的哪个网站好天津网络推广公司