Text processing and i/o performance

I have been fascinated with rust for quite some time now, and have been playing with it for private projects but not yet building a production grade product.
We have a Java application that essentially processes text (csv like) files, normalizes some values based on configuration rules and stores values in a relational database.
Is there realistic reson to exoect that rewriting this tool in rust may increase its performance significantly (assuming both Java and rust implementations are efficient)?

If they're spending almost all of their time waiting for IO, you will probably not see a significant speedup.

1 Like

They are not. they spend some time in IO, not the bulk of it. But a lot of the time is spent looping through the lines in memory, and normalizing the values based on a few rules.
Not super complex logic. But pattern matching and string manipulating.

Rust should be faster than Java when it comes to manipulating data in memory.

Use the crate csv if you can - then you have a Rustic approach to this processing that should save you some memory and copying overhead (basically it does the work needed to realize possible wins over Java).

I guess the best way to know is to create a smallish sample text that uses similar logic in both languages and benchmark.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.