create

command
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

A Go program that addresses the requirements of optimizing performance, memory usage, and disk space while downloading the zip file, processing the CSV data, and creating an SQLite database. Includes the following optimizations:

1. **Memory optimization**: Instead of storing the entire CSV file in memory, the program reads the CSV file line by line using `csv.Reader`. This approach reduces memory consumption, especially for large CSV files, as it only keeps a single record in memory at a time.

2. **Disk space optimization**: The program processes the CSV file directly from disk without extracting it from the zip file. This eliminates the need to extract and store the entire CSV file on disk, resulting in significant disk space savings.

3. **Performance optimization**: The program utilizes a single transaction to insert records into the SQLite database, which improves performance by reducing the overhead of committing each individual record. Additionally, it uses a prepared statement for the insertion, further optimizing the database operations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL