18
C0D4
4y

Go is fast they said, Go is lightweight they said.

package main

import "fmt"

func main() {
var nums []int
for i := 10; i > 0; i++ {
nums = append(nums, i)
i--
}
fmt.Println(nums)
}

# htop
| PID | USER | VIRT | %CPU | %MEM
| 12048 | root | 16.9g | 101.3 | 94.2

WTF is eating my resources to hell and.... oh... oh im a dickhead!

Comments
  • 3
    2 rants later
  • 6
    @devTea all this extra time in semi-isolation. may as well make some rookie mistakes in a new language.

    on a semi related note, i was starting to think this endless loop was affecting you too.
  • 2
    @C0D4 normally I complained but still use it
  • 7
    The best go fail in my opinion was when it unrolled a really long (million iteration) loop for someone on stack overflow and made a 4gb executable
  • 1
    @devTea As one should. It's when the complaints stop that you know something is really wrong.
  • 2
    @SevenDeadlyBugs good to know, i haven't made it to a point of worrying about performance yet, as you can see, im only messing around with 10 iterations at the moment, but ill keep this in mind when i do scale up to real use cases.
  • 8
    @SevenDeadlyBugs thats a "tip" that i expected to be common knowledge and was severely disappointed when i learned the most people dont know. If i ever interview someone, thats gonna be one of the questions
  • 1
    Array and linked list are two different thing. Array work by allocating new memory when it size is full and allow random access.

    Some language should just implement true array
  • 1
    @Kashmir I think it's a tree of hashmaps or something equally horrible that involves a hashmap. I think so because if you use string literals as keys it's exactly as fast as numbers, which I can only explain with stringnames and hashmaps.
  • 0
    I'm more worried of the fact that User column shows 'root'
Add Comment