Skip to content

Commit

Permalink
Remove needless timers
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Aug 31, 2024
1 parent 8b8d5d2 commit 5cc1018
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
19 changes: 0 additions & 19 deletions crates/buffet/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,7 @@ pub trait WriteOwned {
for buf in list.pieces.iter().cloned() {
let buf_len = buf.len();

let before_write = std::time::Instant::now();
tracing::trace!("doing write with buf of len {}", buf_len);
let (res, _) = self.write_owned(buf).await;
tracing::trace!(
"doing write with buf of len {}... done in {:?}",
buf_len,
before_write.elapsed()
);

match res {
Ok(0) => {
return Err(std::io::Error::new(
Expand All @@ -80,14 +72,8 @@ pub trait WriteOwned {
/// Write a list of buffers, re-trying the write if the kernel does a
/// partial write.
async fn writev_all_owned(&mut self, mut list: PieceList) -> std::io::Result<()> {
tracing::trace!("writev_all_owned starts...");
let start = std::time::Instant::now();

while !list.is_empty() {
tracing::trace!("doing writev_owned with {} pieces", list.len());
let before_writev = std::time::Instant::now();
let n = self.writev_owned(&list).await?;
tracing::trace!("writev_owned took {:?}", before_writev.elapsed());

if n == 0 {
return Err(std::io::Error::new(
Expand Down Expand Up @@ -116,11 +102,6 @@ pub trait WriteOwned {
}
}
}
tracing::trace!(
"writev_all_owned starts... and succeeds! took {:?}",
start.elapsed()
);

Ok(())
}

Expand Down
6 changes: 0 additions & 6 deletions crates/buffet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,7 @@ pub fn start<F: Future>(task: F) -> F::Output {
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.on_thread_park(move || {
let start = std::time::Instant::now();
tracing::trace!("thread park, submitting...");
u.submit().unwrap();
tracing::trace!(
"thread park, submitting... done! (took {:?})",
start.elapsed()
);
})
.build()
.unwrap();
Expand Down
6 changes: 0 additions & 6 deletions crates/luring/src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,7 @@ impl<S: squeue::Entry, C: cqueue::Entry> IoUringAsync<S, C> {
pub async fn listen(uring: Rc<IoUringAsync<S, C>>) {
let async_fd = AsyncFd::new(uring).unwrap();
loop {
let start = std::time::Instant::now();
tracing::trace!("waiting for uring fd to be ready...");
let mut guard = async_fd.readable().await.unwrap();
tracing::trace!(
"waiting for uring fd to be ready... it is! (took {:?})",
start.elapsed()
);
guard.get_inner().handle_cqe();
guard.clear_ready();
}
Expand Down

0 comments on commit 5cc1018

Please sign in to comment.