Here a proof of concept of a basic memory profiler for Nit.
The approach is an option `--trace-memory` that generate a logger with the rest of the code.
Each allocation event produce a line in an time-stamped log file.
When compiling nitc with nitc, the generated log is 300MB. Quite big but manageable.
There is not a lot of optimizations, we let the libc cache the writing of the log.
So there is an overhead.
without `--trace-memory`:
* real 0m5.721s
* user 0m7.216s
with it
* real 0m8.730s (+52%, beause IO I think)
* user 0m9.600s (+33%)
To process the log file, a autonomous tool `memplot` is provided that is made of a nit converter to csv and a R plot script.
There is not a lot of usability, configuration is done by hacking the source code :)
Here a result for the nitc compilation
![memory](https://cloud.githubusercontent.com/assets/135828/
16327063/
245d273c-399a-11e6-82d3-
950db85f7326.png)
The PR is divided into 3 parts:
* preparation of the infrastructure in the compiler (agnostic)
* extension of nitc that refines methods to add the logger
* the quick and dirty memplot tool
Pull-Request: #2200
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>