sasha-s / go-deadlock

Online deadlock detection in go (golang)
Apache License 2.0
1.03k stars 76 forks source link

Heads-up and suggestions for improvements #25

Open linkdata opened 1 year ago

linkdata commented 1 year ago

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 of Opts.Disable to avoid all overhead, leverage escape analysis for callers() to lower memory usage and maybe use of TryLock() for Go 1.18+.

sasha-s commented 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