jcasbin / redis-adapter

Redis adapter for Casbin
https://github.com/casbin/jcasbin
Apache License 2.0
5 stars 7 forks source link

the performance can be further improved for addPolicies() #15

Closed xudaren closed 1 year ago

xudaren commented 1 year ago
    > @xudaren already here:

https://github.com/jcasbin/redis-adapter/blob/686bc3e769459ba1f4f98c4ffa519655450010b3/src/main/java/org/casbin/adapter/RedisAdapter.java#L109-L116

the performance can be further improved

Originally posted by @xudaren in https://github.com/jcasbin/redis-adapter/issues/14#issuecomment-1316164788

Otherwise, there are too many network interactions

casbin-bot commented 1 year ago

@tangyang9464 @imp2002

xudaren commented 1 year ago

maybe should implement Dispatcher

package org.casbin.jcasbin.persist;

import java.util.List;

public interface Dispatcher { void addPolicies(String var1, String var2, List<List> var3);

void removePolicies(String var1, String var2, List<List<String>> var3);

void removeFilteredPolicy(String var1, String var2, int var3, String... var4);

void clearPolicy();

void updatePolicy(String var1, String var2, List<String> var3, List<String> var4);

}

xudaren commented 1 year ago

public class RedisAdapter implements Adapter, BatchAdapter

hsluoyz commented 1 year ago

@OutOfEastGate