Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce memory allocation during address change notification. #5613

Merged
merged 22 commits into from
May 7, 2020

Conversation

chickenlj
Copy link
Contributor

  1. Merge registry notification events happened in a certain short interval.
  2. cache URL instances to reduce string -> URL recreation
  3. reduce allocation during export and refer at start up.
  4. add frozen status for URL
  5. use URLBuilder for unfrozen URLs

1 simplify log, 2 cache URL, 3 disable local file snapshot.
1.reduce mem alloc during export&refer,
2.merge registry address notification event
3.add frozen status for URL
@chickenlj chickenlj added the status/don’t-merge No plan to merge label Jan 9, 2020
@guohao
Copy link
Contributor

guohao commented Jan 9, 2020

👍

@chickenlj chickenlj added this to the 2.7.6 milestone Feb 11, 2020
@chickenlj chickenlj modified the milestones: 2.7.6, 2.7.7 Feb 20, 2020
# Conflicts:
#	dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
#	dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
#	dubbo-config/dubbo-config-spring/src/main/resources/META-INF/compat/dubbo.xsd
#	dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
#	dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java
#	dubbo-registry/dubbo-registry-redis/src/main/java/org/apache/dubbo/registry/redis/RedisRegistry.java
@chickenlj chickenlj self-assigned this Apr 3, 2020
@hengyunabc hengyunabc modified the milestones: 2.7.7, 2.7.8 Apr 26, 2020
# Conflicts:
#	dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
#	dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java
#	dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java
# Conflicts:
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/Registry.java
#	dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java
@hengyunabc
Copy link
Contributor

这个PR被 revert掉了,原因是:

原来的url:

dubbo://127.0.0.1:9098/org.apache.dubbo.registry.dubbo.RegistryDirectoryTest$DemoService?check=false&interface=org.apache.dubbo.registry.dubbo.RegistryDirectoryTest$DemoService&lazy=true&methods=getXXX&remote.application=

精简后的url:

dubbo://127.0.0.1:9098?check=false&lazy=true&methods=getXXX&refer=interface%3Dorg.apache.dubbo.registry.dubbo.RegistryDirectoryTest%24DemoService&remote.application=
  1. 精简过后的url里没有了 path
  2. 会导致代码里原来用 url.getPath() 来取得 service name的逻辑失效
  3. 如果客户依赖这个行为,就会出现不兼容问题
  4. 需要再仔细评估

@hengyunabc hengyunabc modified the milestones: 2.7.7, 2.7.8 May 8, 2020
@chickenlj chickenlj mentioned this pull request May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/don’t-merge No plan to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants