Skip to content

Commit

Permalink
feat(pkg/ui): add pprof profiling for performance monitoring
Browse files Browse the repository at this point in the history
- Import pprof for profiling
- Start CPU profiling at the beginning of MainUI
- Serve pprof via HTTP on localhost:6060
- Ensure profiling is stopped when MainUI exits
  • Loading branch information
wellcomez committed Nov 4, 2024
1 parent c9ce122 commit 55de3ef
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 176 deletions.
2 changes: 1 addition & 1 deletion pkg/femto
Submodule femto updated 1 files
+8 −4 view.go
6 changes: 6 additions & 0 deletions pkg/treesittertheme/colorscheme/colorscheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ func main() {
// Foreground = b
// b = ""
// }
if b=="#0"{
b = "#000000"
}
if Foreground == "#0" {
Foreground = "#000000"
}
s := fmt.Sprintf("color-link %s \"%s,%s\"", strings.ToLower(v.Group), strings.ToUpper(Foreground), strings.ToUpper(b))
ret = append(ret, s)
}
Expand Down
18 changes: 9 additions & 9 deletions pkg/treesittertheme/colorscheme/output/base16-dirtysea.micro
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ color-link delimiter "#755B00,#E0E0E0"
color-link specialcomment "#755B00,#E0E0E0"
color-link debug "#840000,#E0E0E0"
color-link underlined "#840000,#E0E0E0"
color-link ignore "#0,#E0E0E0"
color-link ignore "#000000,#E0E0E0"
color-link error "#840000,#E0E0E0"
color-link added "#B3F6C0,#E0E0E0"
color-link changed "#8CF8F7,#E0E0E0"
color-link removed "#FFC0B9,#E0E0E0"
color-link cursorline ",#D0DAD0"
color-link cursorcolumn ",#D0DAD0"
color-link visual ",#D0D0D0"
color-link statusline "#0,#D0D0D0"
color-link normal "#0,#E0E0E0"
color-link statusline "#000000,#D0D0D0"
color-link normal "#000000,#E0E0E0"
color-link diagnosticerror "#840000,#E0E0E0"
color-link diagnosticwarn "#90,#E0E0E0"
color-link diagnosticinfo "#7300,#E0E0E0"
Expand All @@ -56,9 +56,9 @@ color-link lspreferenceread ",#E0E0E0"
color-link lspreferencewrite ",#E0E0E0"
color-link @variable "#840000,#E0E0E0"
color-link @variable.builtin "#840000,#E0E0E0"
color-link @variable.parameter "#0,#E0E0E0"
color-link @variable.parameter "#000000,#E0E0E0"
color-link @variable.parameter.builtin "#755B00,#E0E0E0"
color-link @variable.member "#0,#E0E0E0"
color-link @variable.member "#000000,#E0E0E0"
color-link @constant "#6565,#E0E0E0"
color-link @constant.builtin "#6565,#E0E0E0"
color-link @constant.macro "#6565,#E0E0E0"
Expand All @@ -72,15 +72,15 @@ color-link @function.macro "#840000,#E0E0E0"
color-link @function.method "#7300,#E0E0E0"
color-link @function.method.call "#7300,#E0E0E0"
color-link @constructor "#7300,#E0E0E0"
color-link @operator "#0,#E0E0E0"
color-link @operator "#000000,#E0E0E0"
color-link @string "#730073,#E0E0E0"
color-link @type "#755B00,#E0E0E0"
color-link @type.builtin "#755B00,#E0E0E0"
color-link @type.definition "#755B00,#E0E0E0"
color-link @type.class "#755B00,#E0E0E0"
color-link @attribute "#755B00,#E0E0E0"
color-link @attribute.builtin "#755B00,#E0E0E0"
color-link @property "#0,#E0E0E0"
color-link @property "#000000,#E0E0E0"
color-link @comment "#707070,#E0E0E0"
color-link @keyword "#90,#E0E0E0"
color-link @keyword.coroutine "#90,#E0E0E0"
Expand Down Expand Up @@ -112,7 +112,7 @@ color-link @number "#6565,#E0E0E0"
color-link @number.float "#6565,#E0E0E0"
color-link @markup.strong ",#E0E0E0"
color-link @markup.italic ",#E0E0E0"
color-link @markup.strikethrough "#0,#E0E0E0"
color-link @markup.strikethrough "#000000,#E0E0E0"
color-link @markup.underline ",#E0E0E0"
color-link @markup.heading "#7300,#E0E0E0"
color-link @markup.heading.1 "#7300,#E0E0E0"
Expand All @@ -123,7 +123,7 @@ color-link @markup.heading.5 "#7300,#E0E0E0"
color-link @markup.heading.6 "#7300,#E0E0E0"
color-link @markup.quote "#755B00,#E0E0E0"
color-link @markup.math "#755B00,#E0E0E0"
color-link @markup.link "#0,#E0E0E0"
color-link @markup.link "#000000,#E0E0E0"
color-link @markup.link.label "#755B00,#E0E0E0"
color-link @markup.link.url "#6565,#E0E0E0"
color-link @markup.raw "#6565,#E0E0E0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
color-link linenr "#0,#FFFFFF"
color-link linenr "#000000,#FFFFFF"
color-link comment "#B0B0B0,#FFFFFF"
color-link constant "#FD8900,#FFFFFF"
color-link string "#C918,#FFFFFF"
Expand Down
18 changes: 9 additions & 9 deletions pkg/treesittertheme/colorscheme/output/base16-zenburn.micro
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ color-link storageclass "#E0CF9F,#383838"
color-link structure "#DC8CC3,#383838"
color-link typedef "#E0CF9F,#383838"
color-link special "#93E0E3,#383838"
color-link specialchar "#0,#383838"
color-link specialchar "#000000,#383838"
color-link tag "#E0CF9F,#383838"
color-link delimiter "#0,#383838"
color-link delimiter "#000000,#383838"
color-link specialcomment "#93E0E3,#383838"
color-link debug "#DCA3A3,#383838"
color-link underlined "#DCA3A3,#383838"
Expand Down Expand Up @@ -101,12 +101,12 @@ color-link @string "#5F7F5F,#383838"
color-link @string.documentation "#5F7F5F,#383838"
color-link @string.regexp "#93E0E3,#383838"
color-link @string.escape "#93E0E3,#383838"
color-link @string.special "#0,#383838"
color-link @string.special "#000000,#383838"
color-link @string.special.symbol "#5F7F5F,#383838"
color-link @string.special.url "#DFAF8F,#383838"
color-link @string.special.path "#0,#383838"
color-link @string.special.path "#000000,#383838"
color-link @character "#DCA3A3,#383838"
color-link @character.special "#0,#383838"
color-link @character.special "#000000,#383838"
color-link @boolean "#DFAF8F,#383838"
color-link @number "#DFAF8F,#383838"
color-link @number.float "#DFAF8F,#383838"
Expand All @@ -124,12 +124,12 @@ color-link @markup.heading.6 "#7CB8BB,#383838"
color-link @markup.quote "#93E0E3,#383838"
color-link @markup.math "#93E0E3,#383838"
color-link @markup.link "#DCDCCC,#383838"
color-link @markup.link.label "#0,#383838"
color-link @markup.link.label "#000000,#383838"
color-link @markup.link.url "#DFAF8F,#383838"
color-link @markup.raw "#DFAF8F,#383838"
color-link @markup.raw.block "#DFAF8F,#383838"
color-link @markup.list "#0,#383838"
color-link @markup.list.checked "#0,#383838"
color-link @markup.list.unchecked "#0,#383838"
color-link @markup.list "#000000,#383838"
color-link @markup.list.checked "#000000,#383838"
color-link @markup.list.unchecked "#000000,#383838"
color-link search "#404040,#E0CF9F"
color-link insearch "#404040,#DFAF8F"
10 changes: 5 additions & 5 deletions pkg/treesittertheme/colorscheme/output/delek.micro
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ color-link changed "#7373,#FFFFFF"
color-link removed "#590008,#FFFFFF"
color-link cursorline ",#E4E4E4"
color-link cursorcolumn ",#E4E4E4"
color-link visual "#0,#D0D0D0"
color-link visual "#000000,#D0D0D0"
color-link statusline "#FFFF00,#8B"
color-link normal "#0,#FFFFFF"
color-link normal "#000000,#FFFFFF"
color-link diagnosticerror "#FF0000,#FFFFFF"
color-link diagnosticwarn "#FFA500,#FFFFFF"
color-link diagnosticinfo "#ADD8E6,#FFFFFF"
color-link diagnostichint "#D3D3D3,#FFFFFF"
color-link diffadd "#FFFFFF,#5F875F"
color-link diffchange "#FFFFFF,#5F87AF"
color-link diffdelete "#FFFFFF,#AF5FAF"
color-link lspreferencetext "#0,#D0D0D0"
color-link lspreferenceread "#0,#D0D0D0"
color-link lspreferencewrite "#0,#D0D0D0"
color-link lspreferencetext "#000000,#D0D0D0"
color-link lspreferenceread "#000000,#D0D0D0"
color-link lspreferencewrite "#000000,#D0D0D0"
color-link @variable "#8B8B,#FFFFFF"
color-link @variable.builtin "#FF1493,#FFFFFF"
color-link @variable.parameter "#8B8B,#FFFFFF"
Expand Down
4 changes: 2 additions & 2 deletions pkg/treesittertheme/colorscheme/output/morning.micro
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ color-link removed "#590008,#E4E4E4"
color-link cursorline ",#D3D3D3"
color-link cursorcolumn ",#D3D3D3"
color-link visual ",#D0D0D0"
color-link statusline "#EEEEEE,#0"
color-link normal "#0,#E4E4E4"
color-link statusline "#EEEEEE,#000000"
color-link normal "#000000,#E4E4E4"
color-link diagnosticerror "#FF0000,#E4E4E4"
color-link diagnosticwarn "#FFA500,#E4E4E4"
color-link diagnosticinfo "#ADD8E6,#E4E4E4"
Expand Down
18 changes: 9 additions & 9 deletions pkg/treesittertheme/colorscheme/output/noogies.micro
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ color-link storageclass "#E0CF9F,#383838"
color-link structure "#DC8CC3,#383838"
color-link typedef "#E0CF9F,#383838"
color-link special "#93E0E3,#383838"
color-link specialchar "#0,#383838"
color-link specialchar "#000000,#383838"
color-link tag "#E0CF9F,#383838"
color-link delimiter "#0,#383838"
color-link delimiter "#000000,#383838"
color-link specialcomment "#93E0E3,#383838"
color-link debug "#DCA3A3,#383838"
color-link underlined "#DCA3A3,#383838"
Expand Down Expand Up @@ -101,12 +101,12 @@ color-link @string "#5F7F5F,#383838"
color-link @string.documentation "#5F7F5F,#383838"
color-link @string.regexp "#93E0E3,#383838"
color-link @string.escape "#93E0E3,#383838"
color-link @string.special "#0,#383838"
color-link @string.special "#000000,#383838"
color-link @string.special.symbol "#5F7F5F,#383838"
color-link @string.special.url "#DFAF8F,#383838"
color-link @string.special.path "#0,#383838"
color-link @string.special.path "#000000,#383838"
color-link @character "#DCA3A3,#383838"
color-link @character.special "#0,#383838"
color-link @character.special "#000000,#383838"
color-link @boolean "#DFAF8F,#383838"
color-link @number "#DFAF8F,#383838"
color-link @number.float "#DFAF8F,#383838"
Expand All @@ -124,12 +124,12 @@ color-link @markup.heading.6 "#7CB8BB,#383838"
color-link @markup.quote "#93E0E3,#383838"
color-link @markup.math "#93E0E3,#383838"
color-link @markup.link "#DCDCCC,#383838"
color-link @markup.link.label "#0,#383838"
color-link @markup.link.label "#000000,#383838"
color-link @markup.link.url "#DFAF8F,#383838"
color-link @markup.raw "#DFAF8F,#383838"
color-link @markup.raw.block "#DFAF8F,#383838"
color-link @markup.list "#0,#383838"
color-link @markup.list.checked "#0,#383838"
color-link @markup.list.unchecked "#0,#383838"
color-link @markup.list "#000000,#383838"
color-link @markup.list.checked "#000000,#383838"
color-link @markup.list.unchecked "#000000,#383838"
color-link search "#404040,#E0CF9F"
color-link insearch "#404040,#DFAF8F"
12 changes: 6 additions & 6 deletions pkg/treesittertheme/colorscheme/output/peachpuff.micro
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ color-link changed "#7373,#FFDAB9"
color-link removed "#590008,#FFDAB9"
color-link cursorline ",#F5C195"
color-link cursorcolumn ",#F5C195"
color-link visual "#0,#CCCCCC"
color-link statusline "#FFFFFF,#0"
color-link normal "#0,#FFDAB9"
color-link visual "#000000,#CCCCCC"
color-link statusline "#FFFFFF,#000000"
color-link normal "#000000,#FFDAB9"
color-link diagnosticerror "#FF0000,#FFDAB9"
color-link diagnosticwarn "#FFA500,#FFDAB9"
color-link diagnosticinfo "#ADD8E6,#FFDAB9"
color-link diagnostichint "#D3D3D3,#FFDAB9"
color-link diffadd "#FFFFFF,#5F875F"
color-link diffchange "#FFFFFF,#5F87AF"
color-link diffdelete "#FFFFFF,#AF5FAF"
color-link lspreferencetext "#0,#CCCCCC"
color-link lspreferenceread "#0,#CCCCCC"
color-link lspreferencewrite "#0,#CCCCCC"
color-link lspreferencetext "#000000,#CCCCCC"
color-link lspreferenceread "#000000,#CCCCCC"
color-link lspreferencewrite "#000000,#CCCCCC"
color-link @variable "#8B8B,#FFDAB9"
color-link @variable.builtin "#6A5ACD,#FFDAB9"
color-link @variable.parameter "#8B8B,#FFDAB9"
Expand Down
Loading

0 comments on commit 55de3ef

Please sign in to comment.