iggy icon indicating copy to clipboard operation
iggy copied to clipboard

Improve server performance

Open hubcio opened this issue 1 year ago • 2 comments

  • uuid128 simd
  • less loop over Messages
  • use references

hubcio avatar Jan 26 '24 14:01 hubcio

In iggy server, when writing a file, does the performance suffer if a new file is created for each bytes written?

the code is as follows:

#[async_trait]
impl Persister for FilePersister {
    async fn append(&self, path: &str, bytes: &[u8]) -> Result<(), Error> {
        let mut file = file::append(path).await?;
        file.write_all(bytes).await?;
        Ok(())
    }

    async fn overwrite(&self, path: &str, bytes: &[u8]) -> Result<(), Error> {
        let mut file = file::write(path).await?;
        file.write_all(bytes).await?;
        Ok(())
    }

    async fn delete(&self, path: &str) -> Result<(), Error> {
        fs::remove_file(path).await?;
        Ok(())
    }
}

iamazy avatar Jan 29 '24 10:01 iamazy

@iamazy I already have it addressed on branch persister_via_channels

hubcio avatar Feb 01 '24 10:02 hubcio