Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid creating Strings during distribution gen (WIP) #57

Closed
wants to merge 1 commit into from

Conversation

alamb
Copy link
Collaborator

@alamb alamb commented Mar 21, 2025

I was trying to make the startup time faster and one thing I figured I could do is stop copying strings during text pool generation.

However I made the change to avoid copying and it doesn't really seem to have helped, but I figured I would put up the PR in case someone else was interested

Main

(venv) andrewlamb@Andrews-MacBook-Pro-2:~/Software/tpchgen-rs$ time target/release/tpchgen-cli -s 1 --tables=nation --output-dir=/tmp/tpchdbgen-rs
Generation complete!

real	0m1.955s
user	0m1.901s
sys	0m0.051s

This branch:

branch 'alamb/faster_table_gen' set up to track 'alamb/alamb/faster_table_gen'.
(venv) andrewlamb@Andrews-MacBook-Pro-2:~/Software/tpchgen-rs$ time target/release/tpchgen-cli -s 1 --tables=nation --output-dir=/tmp/tpchdbgen-rs
Generation complete!

real	0m1.953s
user	0m1.910s
sys	0m0.039s

@@ -14,15 +14,15 @@ pub(crate) const DISTS_SEED: &str = include_str!("dists.dss");
#[derive(Debug, Clone)]
pub struct Distribution {
name: String,
values: Vec<String>,
values: Vec<&'static str>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea was to not allocate strings

@alamb
Copy link
Collaborator Author

alamb commented Mar 25, 2025

This was done for real in #63

@alamb alamb closed this Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant