4 ms·
I love this stuff. I'm currently working on a project where, left to my own devices, I would have come up with some complicated scheme that would reduce an O(n)
by Jemaclus 11y ago
I love this stuff. I'm currently working on a project where, left to my own devices, I would have come up with some complicated scheme that would reduce an O(n) (or even O(n^2)) task to O(log n). Fortunately, the guidelines I've been given (government, of course) offer a series of extremely-hard-to-understand-but-O(1) methods for retrieving the data. I haven't benchmarked it yet, but i'd imagine that my process would take about 5ms per record, and this process will probably take something on the order of 5 microseconds per record.
I'm learning all kinds of tricks that older developers can probably do in their sleep. Very cool.
(Note: the reason I say "older" instead of "experienced", even though for these purposes they're interchangeable, is that the tricks I'm learning are coming from a COBOL codebase written back in the 70s that I'm modernizing into Go.)
I also learned a long time ago that lookup tables for common requests are a no-brainer. If you only have 256 possible answers to a formula, just stick them in a lookup table.
Love it.
- ihsw 11y agoMigrating COBOL to Go? Government job? Where is this glorious country?
- molmalo 11y agoI don't want to be the guy rejecting change... But, is someone expecting a project in Go, to last 40+ years as that COBOL codebase lasted?? Wow!
- chipaca 11y agoIt's not because COBOL was good that things written in it lasted; it's because it was there. The things written in it made COBOL last, not vice-versa.