flyweight permissions in server#5556
Conversation
|
Since I opened this PR integration test runtimes may be slightly improved, not much difference really. |
|
|
|
Having suggested the change, I have no particular issue with having this done, but I do wonder if we have any evidence for or against the performance improvement (time or space) of this change. |
|
I've not been able to discern any difference outside the error bars of noise, though it might be interesting to have the PR in partly for that it does throw when it detects that the array has been mutated since it last saw it. |
|
Have you watched the behavior for a running server? What size is typical for |
|
I have a bit but since forgot I'm afraid! There are certainly some hits. 😃 Want me to open an additional temporary PR that adds some monitoring for those? |
|
Could we perhaps get some numbers in a logging statement, perhaps at INFO initially but then can move back to DEBUG? |
|
When to log? Every many-minutes or something? Maybe we don't have to introduce another config property. |
|
Perhaps every 100 modifications or similar? |
|
Given that a running system seems able to generate thousands of cache hits per second and that logging implies statistics-gathering which means more state that needs concurrency protection, my plan tomorrow is to shift the cache to being thread-local. |
7aea406 to
aa81ca6
Compare
aa81ca6 to
6b5a3ff
Compare
|
(Of course, the size of the cache is how many misses there were.) |
52ae3d7 to
0af0543
Compare
|
Pasted some initial output to gh-5586. Looks good. Knowing that |
|
I would say that |
|
Agreeably I am also not seeing any "cache violation" errors being thrown by |
flyweight permissions in server
What this PR does
Introduces a cache for the Boolean arrays associated with permissions restrictions. Then, the server should not hold on for long to many different arrays that represent the same permissions.
Testing this PR
There should be no CI regressions. Watch for differences in server speed, e.g., running time of integration tests. With #5586 reports from each thread's
BooleanArrayCacheevery fifty minutes can be seen on eel in/opt/hudson/workspace/OMERO-DEV-merge-{deploy,integration}/src/dist/var/log/Blitz-0.log.Related reading
https://trello.com/c/SXxKgAC3/8-flyweight-permissions-in-server