Skip to content

Commit a37bdde

Browse files
committed
std::rt: Remove metrics for perf
These aren't used for anything at the moment and cause some TLS hits on some perf-critical code paths. Will need to put better thought into it in the future.
1 parent 0fff8b6 commit a37bdde

File tree

4 files changed

+0
-115
lines changed

4 files changed

+0
-115
lines changed

src/libstd/rt/comm.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,8 @@ impl<T> ChanOne<T> {
144144
match oldstate {
145145
STATE_BOTH => {
146146
// Port is not waiting yet. Nothing to do
147-
do Local::borrow::<Scheduler, ()> |sched| {
148-
rtdebug!("non-rendezvous send");
149-
sched.metrics.non_rendezvous_sends += 1;
150-
}
151147
}
152148
STATE_ONE => {
153-
do Local::borrow::<Scheduler, ()> |sched| {
154-
rtdebug!("rendezvous send");
155-
sched.metrics.rendezvous_sends += 1;
156-
}
157149
// Port has closed. Need to clean up.
158150
let _packet: ~Packet<T> = cast::transmute(this.void_packet);
159151
recvr_active = false;
@@ -251,7 +243,6 @@ impl<T> SelectInner for PortOne<T> {
251243
STATE_BOTH => {
252244
// Data has not been sent. Now we're blocked.
253245
rtdebug!("non-rendezvous recv");
254-
sched.metrics.non_rendezvous_recvs += 1;
255246
false
256247
}
257248
STATE_ONE => {
@@ -267,7 +258,6 @@ impl<T> SelectInner for PortOne<T> {
267258
(*self.packet()).state.store(STATE_ONE, Relaxed);
268259

269260
rtdebug!("rendezvous recv");
270-
sched.metrics.rendezvous_recvs += 1;
271261

272262
// Channel is closed. Switch back and check the data.
273263
// NB: We have to drop back into the scheduler event loop here

src/libstd/rt/metrics.rs

Lines changed: 0 additions & 98 deletions
This file was deleted.

src/libstd/rt/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ pub mod local_ptr;
152152
/// Bindings to pthread/windows thread-local storage.
153153
pub mod thread_local_storage;
154154

155-
pub mod metrics;
156-
157155
// FIXME #5248 shouldn't be pub
158156
/// Just stuff
159157
pub mod util;

src/libstd/rt/sched.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use rt::kill::BlockedTask;
2424
use rt::local_ptr;
2525
use rt::local::Local;
2626
use rt::rtio::{RemoteCallback, PausibleIdleCallback};
27-
use rt::metrics::SchedMetrics;
2827
use borrow::{to_uint};
2928
use cell::Cell;
3029
use rand::{XorShiftRng, RngUtil};
@@ -71,7 +70,6 @@ pub struct Scheduler {
7170
/// An action performed after a context switch on behalf of the
7271
/// code running before the context switch
7372
cleanup_job: Option<CleanupJob>,
74-
metrics: SchedMetrics,
7573
/// Should this scheduler run any task, or only pinned tasks?
7674
run_anything: bool,
7775
/// If the scheduler shouldn't run some tasks, a friend to send
@@ -126,7 +124,6 @@ impl Scheduler {
126124
stack_pool: StackPool::new(),
127125
sched_task: None,
128126
cleanup_job: None,
129-
metrics: SchedMetrics::new(),
130127
run_anything: run_anything,
131128
friend_handle: friend,
132129
rng: XorShiftRng::new(),
@@ -267,10 +264,8 @@ impl Scheduler {
267264
// If we got here then there was no work to do.
268265
// Generate a SchedHandle and push it to the sleeper list so
269266
// somebody can wake us up later.
270-
sched.metrics.wasted_turns += 1;
271267
if !sched.sleepy && !sched.no_sleep {
272268
rtdebug!("scheduler has no work to do, going to sleep");
273-
sched.metrics.sleepy_times += 1;
274269
sched.sleepy = true;
275270
let handle = sched.make_handle();
276271
sched.sleeper_list.push(handle);

0 commit comments

Comments
 (0)