4
Sumafu
5y

I just discovered that Go needs a very long time to compile a 120MB source code file. Beside the fact that the file was very big, it just contained a big amount of byte arrays.
Did anyone had ever such big source code files?

Comments
  • 3
    what the fuck
    Anything will take long to compile 120 MB of fucking text
  • 3
    You just don't disguise that much data as source text. Because it's actually data, not code.
  • 1
    I've worked on some similarly big projects in my time.

    Hate to say it, but the end result of a codebase that big is almost always an unmaintainable mess that takes an age to compile, whatever the language.

    I'd strongly suggest refactoring out what you can into separate libraries to make maintainability a lot easier.
  • 0
    @AlmondSauce luckily the code is generated by a very short script. It actually just contains byte arrays, containing the compiled files of my Angular project. I did this to bundle my html, ja and css in the binary. And in fact, if I compile it in my Linux docker container, the binary is smaller than the original web files.
  • 1
    I would store the data in a separate file and have the program load it dynamically. Otherwise you're going to get long compile times and memory issues. Also yes, have you ever tried compiling Chromium or the Linux kernel from scratch? They take fucking forever
Add Comment