Closed Tiomat85 closed 2 months ago
This is for fixing Issue 44 on usim https://github.com/nion-software/nionswift-usim/issues/44
I tested this code on my machine, it results in an improvement from 220ms (Poisson) to 75ms (Gaussian). This is a welcome improvement, but might not be sufficient for performance testing #44. I added notes there.
The original Issue was that the Poisson noise generation was taking an increasing amount of time as the exposure increased, as it became too long. The solution of changing to a Gaussian distribution for 'high' values of lambda (exposure) resolves this original problem. So what you now get is increasing time calculated until you hit this threshold and then it flatlines which is exactly what the original issue wanted.
I'm confused as to the reasoning of adding in extra complexity, with no particular defined requirement or use cases. If there is a defined test or objective that is not being met then at that point you can look at implementing something a bit more complicated as you have a pass criteria of the fix being done. Without that any performance work can easily hit this scenario, where the defined problem is resolved and performance 'improved' but with no end line there is no ability to say it is 'done'.
As a reminder, the title of the PR is not the permanent title of the commit message. You would need to git commit --amend
to edit the commit message, then force push to this PR to clean it up. It's much easier to write good commit messages in the first place. Btw, I'm planning to merge this as soon as @Brow71189 gives his ok.
Merged aec8bc55d3e8da87d4f27ca1428fefba86bbc6b6
Adding check and handling of Poisson noise generation when lambda is high to fallback to a Gaussian distribution for performance reasons.