4 ms·
> For example, here's a trivial sscanf() rewrite "sscanf rewrite" implies you wrote a general purpose replacement. This just parses a fixed format. That is not
by asveikau 6y ago
> For example, here's a trivial sscanf() rewrite
"sscanf rewrite" implies you wrote a general purpose replacement. This just parses a fixed format. That is not an sscanf rewrite.
The way you phrased it sounds like they could drop it into an existing libc and do better.
- apankrat 6y agoDon't get carried away with misquoting or you end up with a strawman. It's "sscanf() rewrite for a log parsing case", not "sscanf rewrite".
- zerr 6y agoI also understood it as ((sscanf() rewrite) for a log parsing case) :)
- rat9988 6y agoI understood it the same way until I saw his limited implementation, and then revised my understanding. It seems pretty obvious to me that he isn't writing a sscanf clone.
- zoomablemind 6y agoThere are other word choices than 'rewrite' that describe that implementation without confusing the context. For example, "log parsing without using sscanf()", or "sscanf()-like parsing using fixed formats". Saves the need to lookup the actual code in disbelief.
- ChrisLomont 6y agoIt's not misquoting. It's poorly chosen words that were misleading. I too thought you meant you either replaced sscanf with a faster equivalent or used sscanf to beat something else. Instead write "I replaced sscanf with single use code", but then the speed improvement is not that interesting.
- underdeserver 6y agoDisagree that it's not interesting. It's just that the message is "sscanf is not necessarily the best tool for hot paths", not "sscanf is currently poorly written".
- asveikau 6y agoI didn't misquote anything.
- bregma 6y agoA more useful paraphrase would be "sscanf() is slow. Here's some code that doesn't use it and it's much faster."