Skip to content

Commit 61a6199

Browse files
authored
doc: describe the new 4th column of the profiler output, and its compatibility with tcc & multithreading; describe better the stib comp parameter (#24358)
1 parent ead4d90 commit 61a6199

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎doc/docs.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5532,7 +5532,9 @@ The generated profile.txt file will have lines with 4 columns:
55325532
1. How many times a function was called.
55335533
2. How much time in total a function took (in ms).
55345534
3. How much time on average, a call to a function took (in ns).
5535-
4. The name of the v function.
5535+
4. How much time a function took (in ms), on its own, without the calls inside it.
5536+
It is reliable for multithreaded programs, when tcc is not used.
5537+
5. The name of the v function.
55365538

55375539
You can sort on column 3 (average time per function) using:
55385540
`sort -n -k3 profile.txt|tail`

‎vlib/stbi/stbi.c.v‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,23 @@ fn C.stbi_write_jpg(filename &char, w int, h int, comp int, buffer &u8, quality
210210

211211
// stbi_write_png write on path a PNG file
212212
// row_stride_in_bytes is usually equal to: w * comp
213+
// comp is the number of channels
213214
pub fn stbi_write_png(path string, w int, h int, comp int, buf &u8, row_stride_in_bytes int) ! {
214215
if 0 == C.stbi_write_png(&char(path.str), w, h, comp, buf, row_stride_in_bytes) {
215216
return error('stbi_image failed to write png file to "${path}"')
216217
}
217218
}
218219

219220
// stbi_write_png write on path a BMP file
221+
// comp is the number of channels
220222
pub fn stbi_write_bmp(path string, w int, h int, comp int, buf &u8) ! {
221223
if 0 == C.stbi_write_bmp(&char(path.str), w, h, comp, buf) {
222224
return error('stbi_image failed to write bmp file to "${path}"')
223225
}
224226
}
225227

226228
// stbi_write_png write on path a TGA file
229+
// comp is the number of channels
227230
pub fn stbi_write_tga(path string, w int, h int, comp int, buf &u8) ! {
228231
if 0 == C.stbi_write_tga(&char(path.str), w, h, comp, buf) {
229232
return error('stbi_image failed to write tga file to "${path}"')
@@ -233,6 +236,7 @@ pub fn stbi_write_tga(path string, w int, h int, comp int, buf &u8) ! {
233236
// stbi_write_png write on path a JPG file
234237
// quality select the compression quality of the JPG
235238
// quality is between 1 and 100. Higher quality looks better but results in a bigger image.
239+
// comp is the number of channels
236240
pub fn stbi_write_jpg(path string, w int, h int, comp int, buf &u8, quality int) ! {
237241
if 0 == C.stbi_write_jpg(&char(path.str), w, h, comp, buf, quality) {
238242
return error('stbi_image failed to write jpg file to "${path}"')

0 commit comments

Comments
 (0)