Commit c476050
committed
refactor(metrics): avoid temporary buffer when serializing metrics
Metrics are currently written in a temporary buffer (String) before
being written to the file.
There is no need for this temporary buffer, as the metrics can be
serialized directly into the writer.
I found this as I saw Firecracker was allocating and freeing memory
every minute, causing pages to be mmap/munmap-ed periodically (and
unnecessarily).
Signed-off-by: Riccardo Mancini <[email protected]>1 parent a02fc1e commit c476050
1 file changed
+5
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
166 | 149 | | |
167 | 150 | | |
168 | 151 | | |
| |||
0 commit comments