Skip to content

Commit

Permalink
removed outdated built-in scope profiler
Browse files Browse the repository at this point in the history
- it is basically useless since it requires code modification to measure anything
  • Loading branch information
mrDIMAS committed Sep 16, 2024
1 parent 7ad56ae commit 14fb818
Show file tree
Hide file tree
Showing 38 changed files with 24 additions and 645 deletions.
4 changes: 1 addition & 3 deletions editor/src/asset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::{
},
core::{
color::Color, futures::executor::block_on, log::Log, make_relative_path,
parking_lot::lock_api::Mutex, pool::Handle, scope_profile, TypeUuidProvider, Uuid,
parking_lot::lock_api::Mutex, pool::Handle, TypeUuidProvider, Uuid,
},
engine::Engine,
graph::BaseSceneGraph,
Expand Down Expand Up @@ -937,8 +937,6 @@ impl AssetBrowser {
engine: &mut Engine,
sender: MessageSender,
) {
scope_profile!();

self.inspector.handle_ui_message(message, engine);
self.preview.handle_message(message, engine);
if self.context_menu.handle_ui_message(message, engine) {
Expand Down
6 changes: 1 addition & 5 deletions editor/src/command/panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// SOFTWARE.

use crate::fyrox::{
core::{color::Color, pool::Handle, scope_profile},
core::{color::Color, pool::Handle},
gui::{
brush::Brush,
button::ButtonMessage,
Expand Down Expand Up @@ -130,8 +130,6 @@ impl CommandStackViewer {
}

pub fn handle_ui_message(&self, message: &UiMessage) {
scope_profile!();

if let Some(ButtonMessage::Click) = message.data::<ButtonMessage>() {
if message.destination() == self.undo {
self.sender.send(Message::UndoCurrentSceneCommand);
Expand All @@ -149,8 +147,6 @@ impl CommandStackViewer {
command_names: Vec<String>,
ui: &mut UserInterface,
) {
scope_profile!();

let items = command_names
.into_iter()
.enumerate()
Expand Down
3 changes: 0 additions & 3 deletions editor/src/configurator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::fyrox::{
core::{
algebra::Vector2,
pool::Handle,
scope_profile,
visitor::{Visit, VisitResult, Visitor},
},
gui::{
Expand Down Expand Up @@ -280,8 +279,6 @@ impl Configurator {
}

pub fn handle_ui_message(&mut self, message: &UiMessage, engine: &mut Engine) {
scope_profile!();

if let Some(WindowMessage::Close) = message.data::<WindowMessage>() {
if message.destination() == self.window {
// Save history for next editor runs.
Expand Down
3 changes: 0 additions & 3 deletions editor/src/interaction/navmesh/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use crate::fyrox::{
color::Color,
math::{ray::CylinderKind, TriangleEdge},
pool::Handle,
scope_profile,
uuid::{uuid, Uuid},
TypeUuidProvider,
},
Expand Down Expand Up @@ -127,8 +126,6 @@ impl NavmeshPanel {
}

pub fn handle_message(&mut self, message: &UiMessage, editor_selection: &Selection) {
scope_profile!();

if let Some(ButtonMessage::Click) = message.data::<ButtonMessage>() {
if message.destination() == self.connect_edges {
if let Some(selection) = fetch_selection(editor_selection) {
Expand Down
11 changes: 0 additions & 11 deletions editor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ use crate::{
futures::executor::block_on,
log::{Log, MessageKind},
pool::Handle,
scope_profile,
task::TaskPool,
uuid::Uuid,
watcher::FileSystemWatcher,
Expand Down Expand Up @@ -1157,8 +1156,6 @@ impl Editor {
}

pub fn handle_ui_message(&mut self, message: &mut UiMessage) {
scope_profile!();

// Prevent infinite message loops.
if message.has_flags(MSG_SYNC_FLAG) {
return;
Expand Down Expand Up @@ -1596,8 +1593,6 @@ impl Editor {
}

fn sync_to_model(&mut self) {
scope_profile!();

for_each_plugin!(self.plugins => on_sync_to_model(self));

let engine = &mut self.engine;
Expand Down Expand Up @@ -2156,8 +2151,6 @@ impl Editor {
}

fn poll_ui_messages(&mut self) -> usize {
scope_profile!();

let mut processed = 0;

while let Some(mut ui_message) = self.engine.user_interfaces.first_mut().poll_message() {
Expand Down Expand Up @@ -2267,8 +2260,6 @@ impl Editor {
}

fn update(&mut self, dt: f32) {
scope_profile!();

for_each_plugin!(self.plugins => on_update(self));

self.handle_modes();
Expand Down Expand Up @@ -2913,8 +2904,6 @@ fn set_ui_scaling(ui: &UserInterface, scale: f32) {
}

fn update(editor: &mut Editor, window_target: &EventLoopWindowTarget<()>) {
scope_profile!();

let elapsed = editor.game_loop_data.clock.elapsed().as_secs_f32();
editor.game_loop_data.clock = Instant::now();
editor.game_loop_data.lag += elapsed;
Expand Down
4 changes: 1 addition & 3 deletions editor/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// SOFTWARE.

use crate::fyrox::{
core::{log::Log, pool::Handle, reflect::prelude::*, scope_profile},
core::{log::Log, pool::Handle, reflect::prelude::*},
gui::{
button::{ButtonBuilder, ButtonMessage},
formatted_text::WrapMode,
Expand Down Expand Up @@ -297,8 +297,6 @@ impl LightPanel {
game_scene: &GameScene,
engine: &mut Engine,
) {
scope_profile!();

if let Some(ButtonMessage::Click) = message.data::<ButtonMessage>() {
if message.destination() == self.generate {
let scene = &mut engine.scenes[game_scene.scene];
Expand Down
3 changes: 0 additions & 3 deletions editor/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::fyrox::{
core::{
log::{LogMessage, MessageKind},
pool::Handle,
scope_profile,
},
gui::{
border::BorderBuilder,
Expand Down Expand Up @@ -204,8 +203,6 @@ impl LogPanel {
}

pub fn handle_ui_message(&mut self, message: &UiMessage, engine: &mut Engine) {
scope_profile!();

if let Some(ButtonMessage::Click) = message.data::<ButtonMessage>() {
if message.destination() == self.clear {
engine
Expand Down
6 changes: 1 addition & 5 deletions editor/src/menu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
animation::AnimationEditor,
export::ExportWindow,
fyrox::{
core::{algebra::Vector2, pool::Handle, scope_profile},
core::{algebra::Vector2, pool::Handle},
gui::{
menu::{MenuBuilder, MenuItemBuilder, MenuItemContent},
message::{MessageDirection, UiMessage},
Expand Down Expand Up @@ -172,8 +172,6 @@ impl Menu {
}

pub fn sync_to_model(&mut self, has_active_scene: bool, ui: &mut UserInterface) {
scope_profile!();

for &widget in [
self.file_menu.close_scene,
self.file_menu.save,
Expand All @@ -192,8 +190,6 @@ impl Menu {
}

pub fn handle_ui_message(&mut self, message: &UiMessage, mut ctx: MenuContext) {
scope_profile!();

if let Some(entry) = ctx.game_scene.as_mut() {
self.edit_menu.handle_ui_message(
message,
Expand Down
3 changes: 0 additions & 3 deletions editor/src/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use crate::fyrox::{
color::Color,
math::aabb::AxisAlignedBoundingBox,
pool::Handle,
scope_profile,
},
gui::{
button::{ButtonBuilder, ButtonMessage},
Expand Down Expand Up @@ -284,8 +283,6 @@ impl PreviewPanel {
}

pub fn handle_message(&mut self, message: &UiMessage, engine: &mut Engine) {
scope_profile!();

let scene = &mut engine.scenes[self.scene];

if let Some(ButtonMessage::Click) = message.data::<ButtonMessage>() {
Expand Down
4 changes: 1 addition & 3 deletions editor/src/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use crate::settings::build::{BuildCommand, BuildProfile, EnvironmentVariable};
use crate::{
fyrox::{
core::{log::Log, pool::Handle, reflect::prelude::*, scope_profile},
core::{log::Log, pool::Handle, reflect::prelude::*},
gui::{
button::{ButtonBuilder, ButtonMessage},
grid::{Column, GridBuilder, Row},
Expand Down Expand Up @@ -372,8 +372,6 @@ impl SettingsWindow {
settings: &mut Settings,
sender: &MessageSender,
) {
scope_profile!();

if let Some(ButtonMessage::Click) = message.data::<ButtonMessage>() {
if message.destination() == self.ok {
engine
Expand Down
4 changes: 1 addition & 3 deletions editor/src/world/graph/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
command::{Command, CommandGroup},
fyrox::{
asset::untyped::UntypedResource,
core::{algebra::Vector2, algebra::Vector3, pool::Handle, reflect::Reflect, scope_profile},
core::{algebra::Vector2, algebra::Vector3, pool::Handle, reflect::Reflect},
graph::BaseSceneGraph,
gui::{
file_browser::FileSelectorMessage,
Expand Down Expand Up @@ -205,8 +205,6 @@ impl SceneNodeContextMenu {
sender: &MessageSender,
settings: &Settings,
) {
scope_profile!();

if let Some(node) = self.create_child_entity_menu.handle_ui_message(
message,
sender,
Expand Down
3 changes: 0 additions & 3 deletions editor/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use crate::{
core::{
color::Color,
pool::{ErasedHandle, Handle},
scope_profile,
},
graph::{BaseSceneGraph, SceneGraph},
gui::{
Expand Down Expand Up @@ -672,8 +671,6 @@ impl WorldViewer {
ui: &UserInterface,
settings: &mut Settings,
) {
scope_profile!();

if let Some(TreeRootMessage::Selected(selection)) = message.data::<TreeRootMessage>() {
if message.destination() == self.tree_root
&& message.direction() == MessageDirection::FromWidget
Expand Down
1 change: 0 additions & 1 deletion fyrox-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub mod math;
pub mod net;
pub mod numeric_range;
pub mod pool;
pub mod profiler;
pub mod quadtree;
pub mod rectpack;
pub mod reflect;
Expand Down
Loading

0 comments on commit 14fb818

Please sign in to comment.