6

使用 mybatis plus, springboot 启动特别慢,初始化 addMappedStatement 耗时很久

 2 years ago
source link: https://www.v2ex.com/t/793983
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  程序员

使用 mybatis plus, springboot 启动特别慢,初始化 addMappedStatement 耗时很久

  li24361 · 1 天前 · 1179 次点击

我看也有 issue 问了,换来的一顿嘲讽

https://github.com/baomidou/mybatis-plus/issues/1154

image_1628212235872.png

最近也一直在排查这个问题,还没有思路,mp 内置了很多原生的,但是遇到几百个上千个表的工程,这个启动速度就很可怕了

18 条回复    2021-08-06 14:42:40 +08:00

polyang

polyang   1 天前

个人观点:启动慢点没啥,只要不是接口响应慢就行

cxshun

cxshun   1 天前

几百上千个表的不是应该考虑拆分服务了,不只 Entity 和 Repository 的问题,单单什么 Service, Controller 啥的扫描都要挺久了。所以应该考虑的是缩小规模。

cnzjl

cnzjl   1 天前

毕竟是 mybatis 的强化版本,不过这个回复也是。。。

wxw752

wxw752   1 天前   ❤️ 2

不要慌,毕竟是带薪启动

polyang

polyang   1 天前

@cxshun 说的有道理,谁 TM 会在一个服务里面搞上千张表。一般最多一百多张表之后就考虑拆服务了

dranfree

dranfree   1 天前   ❤️ 1

这个框架作者的脾气一直不好,喜欢怼人,好多 issue 的回复都是类似的语气。。。不过框架还是挺好用的

jiaojiaobert

jiaojiaobert   1 天前

看看 jvm 里面肯定是做了一次 full gc

pengtdyd

pengtdyd   1 天前

你就没有考虑过是不是 IDE 的问题?

sagaxu

sagaxu   1 天前 via Android

有些项目是按天分的表,保留最近一个月数据,几千上万张表很正常

HolmesYe123

HolmesYe123   1 天前

@sagaxu 按天分表,这个想法很牛逼

MineDog

MineDog   1 天前

@sagaxu #9 按天分表情况下 mapper 不需要多个,一个就行啊

fpure

fpure   1 天前

根本没必要用 mybatis plus,mybatis+自定义代码生成器足矣

efaun

efaun   1 天前

@HolmesYe123 #10 可能你没接触过大数据

li24361

li24361   1 天前

@cxshun 有苦难言,为了事务一致性,所以引了其他模块的 dao 层,最后相当于引用了全部的表

beichenhpy

beichenhpy   1 天前 via Android

这个 miemie 就是这样的,感觉自己了不起很有优越感,遇到问题先去嘲讽提 issue 的人,相比而言 hubin 就很好

potatowish

potatowish   1 天前 via iPhone

有 issue 先来这里问,不然就是一顿嘲讽

chanchan

chanchan   1 天前

一个人回复基本就这个风格,像是生活不如意

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK