Open linkdata opened 1 year ago
Changes look good. Build tags — I know some folks are doing it manually now in their projects when using go-deadlock.
If you want to merge your changes in the original repo, I am happy to work with you (would need to clean up the readme).
if you want to keep it separate; it is also perfectly fine.
@linkdata
This is a great package, but it was missing some features I needed and there were some low-hanging optimization fruit to pluck. Rather than submitting a massive PR, I felt it was easier and faster to just clone and rewrite where needed. I give full credit to you for the original work, of course.
You might consider incorporating some of the changes made in the clone (https://github.com/linkdata/deadlock). Specifically the use of
runtime.CallersFrames
to get correct line numbers, using build tags instead ofOpts.Disable
to avoid all overhead, leverage escape analysis forcallers()
to lower memory usage and maybe use ofTryLock()
for Go 1.18+.