Depending on the actual requirements for a precise threshold and the amount of hysteresis needed (you are adding hysteresis, aren't you?), did you consider the use of a single gate Schmitt trigger (74xxx1G14 family)?
They are small, cheap and require no external passives, just a decoupling cap.
I sure did @newbrain - and amazingly I actually found a 6-gate 40-series in my lolly box from decades ago! I also found an LM358 that I thought I had around the same time - embedded in my foot. (Note to self, put the top back on the IC box when the cat is around.
) Never ceases to amaze me the stuff I've bought and put to one side for another day.
Right now this is only at a very early stage of proof of concept and there are other ways I can achieve what I'm up to. But the point about being simple by design also dictates what's needed. This part is a one-shot following an integrator driven by a constant current source so the voltage continues to rise (until it the current source maxes out) but by that point the rest has triggered so...
Adding a Schmitt isn't necessarily a bad idea but I can't see any real use mathematically but as math isn't my strong suit I'm willing to listen to advice from those wiser (and probably younger) than me.
Development is a strange process and looking at some new libraries last night made me think that I'm may be using the wrong MCU for any final design. Speed is a factor here - not for the pure electronics as that's sloth-like but for the display which would benefit from a much faster SPI bus. I've worked with a parallel-bus board on a 328p and managed to get some fairly impressive speed by tweaking the Adafruit library to use 8-bit where only 8 bits are needed, but using the SAMD21 over SPI the results are a little disappointing considering the chip is clocked at 3x faster.
This little fella (the software, not the chap behind it) looks very interesting and seems to support a lot of board/MCU combinations. His demo video (which, of course, I can't find now!) really made me sit up and take notice.
https://www.arduinolibraries.info/libraries/gfx-library-for-arduino