Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Protip: Compute the size before you allocate

Name: Cudder !cXCudderUE 2015-05-02 16:06

I've lost track of how many times I've seen code that uses a dynamically-expanding array when it could've easily calculated the correct size and allocated exactly the right amount. See: string appending, tokenising, just about everything written in JavaScript, etc.

No wonder software is so slow and bloated...

Name: Anonymous 2015-05-04 6:15

>>23
Cudder-san,
1. B-Trees with forwarding links at the leaves
2. Counting cycles is valid, but...
3. JS is not for microcontrollers
4. I would cry in joy if adding elements took 0 cycles
5. Some resizes may not need copying
6. Serious strings are not byte arrays
7. Imperative foreach instead of functional Array.join() deserves Lv.10 Slow!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List