avinassh / avinassh/fast-sqlite3-inserts

Rust reuse memory

Open
#10 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
410
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Rather than creating the Vec in the inner loop, you can create it in the outer loop using with_capacity with capacity of batch size so it will not allocate in inner loop, then just reuse the Vec.

Once the execute is used, can just Vec clear to clear the items without deallocating memory. I wonder how much faster will it make.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.