Skip to content

Commit 720230c

Browse files
committed
fix profiler
I updated puffin to egui v0.29.1 and now it works Signed-off-by: William Casarin <[email protected]>
1 parent 323d1bc commit 720230c

File tree

5 files changed

+58
-67
lines changed

5 files changed

+58
-67
lines changed

Cargo.lock

+41-64
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ nostrdb = { workspace = true }
3939
enostr = { path = "enostr" }
4040
serde_json = "1.0.89"
4141
env_logger = "0.10.0"
42-
puffin_egui = { version = "0.27.0", optional = true }
43-
puffin = { version = "0.19.0", optional = true }
42+
puffin_egui = { git = "https://github.com/jb55/puffin", package = "puffin_egui", rev = "70ff86d5503815219b01a009afd3669b7903a057", optional = true }
43+
puffin = { git = "https://github.com/jb55/puffin", package = "puffin", rev = "70ff86d5503815219b01a009afd3669b7903a057", optional = true }
4444
hex = "0.4.3"
4545
base32 = "0.4.0"
4646
strum = "0.26"

src/ui/note/context.rs

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ impl NoteContextButton {
9999
}
100100

101101
pub fn show(ui: &mut egui::Ui, note_key: NoteKey, put_at: Rect) -> egui::Response {
102+
#[cfg(feature = "profiling")]
103+
puffin::profile_function!();
104+
102105
let id = ui.id().with(("more_options_anim", note_key));
103106

104107
let min_radius = Self::min_radius();
@@ -140,6 +143,9 @@ impl NoteContextButton {
140143
ui: &mut egui::Ui,
141144
button_response: egui::Response,
142145
) -> Option<NoteContextSelection> {
146+
#[cfg(feature = "profiling")]
147+
puffin::profile_function!();
148+
143149
let mut context_selection: Option<NoteContextSelection> = None;
144150

145151
stationary_arbitrary_menu_button(ui, button_response, |ui| {

src/ui/note/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ impl<'a> NoteView<'a> {
413413
options: NoteOptions,
414414
container_right: Pos2,
415415
) -> NoteResponse {
416+
#[cfg(feature = "profiling")]
417+
puffin::profile_function!();
418+
416419
let note_key = note.key().unwrap();
417420

418421
let inner_response = ui.horizontal(|ui| {
@@ -669,6 +672,9 @@ fn render_note_actionbar(
669672
note_id: &[u8; 32],
670673
note_key: NoteKey,
671674
) -> egui::InnerResponse<Option<NoteAction>> {
675+
#[cfg(feature = "profiling")]
676+
puffin::profile_function!();
677+
672678
ui.horizontal(|ui| {
673679
let reply_resp = reply_button(ui, note_key);
674680
let quote_resp = quote_repost_button(ui, note_key);

src/unknowns.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ pub fn get_unknown_note_ids<'a>(
275275
note: &Note<'a>,
276276
ids: &mut HashSet<UnknownId>,
277277
) -> Result<()> {
278-
// the author pubkey
278+
#[cfg(feature = "profiling")]
279+
puffin::profile_function!();
279280

281+
// the author pubkey
280282
if ndb.get_profile_by_pubkey(txn, note.pubkey()).is_err() {
281283
ids.insert(UnknownId::Pubkey(Pubkey::new(*note.pubkey())));
282284
}

0 commit comments

Comments
 (0)