Skip to content

Latest commit

 

History

History
57 lines (49 loc) · 2.07 KB

README.md

File metadata and controls

57 lines (49 loc) · 2.07 KB

Model

Model

Endpoints

Run the application using the following command:

python manage.py runserver

Tests

Run tests using the following command:

python manage.py test

Solution 1: Sequential Insertion

Insert all products and their variants using the create method sequentially.

Endpoint: http://127.0.0.1:8000/inventory/products

Test Results:

Create Method

Solution 2: Bulk Insertion

Insert products and their variants using the bulk_create method.

Endpoint: http://127.0.0.1:8000/inventory/products-bulk

Test Results:

Bulk Create Method

Analysis:

Runtime:

  • Blulk Insertion solution has approximately less runtime than the sequential solution. Especially for the larger dataset as seen with the 1000 products the execution time decreased from 26.08s to 8.44s.

memory usage:

  • There was a slight increase in memory for the bulk insertion solution compared to the sequential insertion solution

Solution 2 Bulk Insertion is the more optimal solution because of faster runtime