alibaba / sentinel-golang

Sentinel Go enables reliability and resiliency for Go microservices
https://sentinelguard.io/
Apache License 2.0
2.76k stars 431 forks source link

[BUG] resource that are not loaded cause additional consumption #530

Open binbin0325 opened 1 year ago

binbin0325 commented 1 year ago

Issue Description

Type: bug report

Describe what happened

resource that are not loaded cause additional consumption

如果调用Entry()时 传递的resource 并没有提前load,按照目前的实现并不能快速返回而且还会创建底层的统计结构,造成额外的资源浪费。

Describe what you expected to happen

如果调用Entry()时 传递的resource 没有被提前load,提供快速路径,直接返回不做任何处理。

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?