Author SHA1 Message Date
micialware 144e258292 Add performance measuring 2026-09-22 00:05:25 +03:00
3 changed files with 786 additions and 29 deletions

No files matched your search

Generated
+777 -27
View File
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -4,7 +4,7 @@ version = "0.2.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
iced = { version = "0.14.0", features = ["tokio", "svg", "lazy", "crisp", "tiny-skia", "wayland", "wgpu"], default-features = false} iced = { version = "0.14.0", features = ["tokio", "svg", "lazy", "crisp", "tiny-skia", "wayland", "wgpu", "tester"], default-features = false}
iced_core = "0.14.0" iced_core = "0.14.0"
rand = "0.10.3" rand = "0.10.3"
dirs = "7.0.0" dirs = "7.0.0"
@@ -28,6 +28,7 @@ env_logger = "0.11.11"
log = "0.4.34" log = "0.4.34"
fsrs = "6.6.2" fsrs = "6.6.2"
litemap = { version = "0.8.3" } litemap = { version = "0.8.3" }
remote_marker = {git = "https://gitea.micialware.ru/micialware/remote_marker"}
[profile.super-release] [profile.super-release]
inherits = "release" inherits = "release"
+7 -1
View File
@@ -32,6 +32,8 @@ use iced::{Element, Task};
use iced_core::Length::Fill; use iced_core::Length::Fill;
use log::{debug, info}; use log::{debug, info};
use std::time::Instant; use std::time::Instant;
use chrono::Local;
use remote_marker::{alias, push};
impl Default for ScreenState { impl Default for ScreenState {
fn default() -> Self { fn default() -> Self {
@@ -91,6 +93,9 @@ pub struct ScreenState {
impl ScreenState { impl ScreenState {
pub fn boot() -> (ScreenState, Task<RootMessage>) { pub fn boot() -> (ScreenState, Task<RootMessage>) {
let time = Local::now().timestamp_millis();
alias("frame", format!("frame_{}", time).as_str());
alias("update", format!("update_{}", time).as_str());
info!("Booting"); info!("Booting");
create_db(); create_db();
info!("Db created"); info!("Db created");
@@ -186,7 +191,7 @@ impl ScreenState {
); );
} }
debug!("Update took {:?}", time.elapsed()); debug!("Update took {:?}", time.elapsed());
push("update", time.elapsed().as_nanos());
task.0 task.0
} }
@@ -231,6 +236,7 @@ impl ScreenState {
let notifications = self.notification_manager.draw().map(Notification); let notifications = self.notification_manager.draw().map(Notification);
debug!("View took {:?}", time.elapsed()); debug!("View took {:?}", time.elapsed());
push("frame", time.elapsed().as_nanos());
stack![view, notifications].width(Fill).height(Fill).into() stack![view, notifications].width(Fill).height(Fill).into()
} }