3 ms·
What do you think a GC does? It will use more memory but the design of the library using it pays a huge role. D's standard library is intended to be as lazy and
by mhh__ 6y ago
What do you think a GC does? It will use more memory but the design of the library using it pays a huge role. D's standard library is intended to be as lazy and efficient as possible within its API (i.e. most ranges are lazy and work on the stack to start with)
Also, quick tip for anyone writing scripts with a GC or malloc/free: turn the collections/free off and just allocate until you finish the script. The OS collects the memory and you save a few seconds.
- rsa25519 6y agoI agree that this is helpful sometimes, but reading this causes flashbacks to deleting files and killing processes manually while watching htop, hoping that a serveral-hour-long process won't die in its last few minutes
- mhh__ 6y agoOh yeah. Definitely small batch jobs only, it's a good trick for parsing too if you know (MEASURED) it's a small % of the task but very memory intensive or fucking the cache up.