[OT] parsing with sscanf is accidentally quadratic due to strlen

Nick Treleaven nick at geany.org
Wed Mar 3 16:19:48 UTC 2021


On Wednesday, 3 March 2021 at 15:16:03 UTC, Simen Kjærås wrote:
> Dawson’s first law of computing: O(n^2) is the sweet spot of 
> badly scaling algorithms: fast enough to make it into 
> production, but slow enough to make things fall down once it 
> gets there.

I think some years back, Andrei proposed using a user-defined 
attribute to tag functions with their big-O time complexity and 
maybe even use those attributes to calculate complexity of 
chained function calls.


More information about the Digitalmars-d mailing list