Hacker News new | ask | show | jobs
by dspillett 482 days ago
> > race conditions […] I never though it could cause performance issues. But it makes sense, you could corrupt the data in a way that creates an infinite loop.

Even without corruption a race condition can cause significant performance issues by causing the same work to be done many times with only one result being kept.

> Food for thought. I often think to myself that any error or strange behavior or even warnings in a project should be fixed as a matter of principle

For warnings: at least explained in a comment, where it has been decided irrelevant (preferably with a pragma to turn off the warning as locally as possible).

Strange behaviour I prefer to get rid of. I've found code marked (by me at least once!) "not sure why this works, but" which very much no longer works, and had to rewrite in a rush where if it had been addressed earlier there would have been more time to be careful.

1 comments

There are so many of these in some projects that starting to fix them kills it.

Only time to fix is just after it is discovered - or mostly never ever because it becomes expensive to build up the context in mind again.