Skip to content

Commit

Permalink
Add pre-optimized perf chart
Browse files Browse the repository at this point in the history
  • Loading branch information
StarDylan committed Dec 5, 2023
1 parent c8614eb commit 2614a85
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
11 changes: 11 additions & 0 deletions fake_data_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ def get_random_string(length):
constraint users_playlist_position_playlist_id_fkey foreign key (playlist_id) references playlists (id),
constraint users_playlist_position_playlist_song_position_fkey foreign key (playlist_song_position) references playlist_songs (id) on update restrict on delete set null,
constraint users_playlist_position_user_id_fkey foreign key (user_id) references users (id) on delete cascade
) tablespace pg_default;
create table
public.user_moods (
user_id bigint generated by default as identity,
last_updated timestamp with time zone not null default now(),
mood text not null,
songs_played bigint not null,
constraint user_moods_pkey primary key (user_id),
constraint user_moods_user_id_key unique (user_id),
constraint user_moods_user_id_fkey foreign key (user_id) references users (id) on update cascade on delete cascade
) tablespace pg_default;"""))


Expand Down
19 changes: 17 additions & 2 deletions performance_writeup.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,23 @@ The rest of the counts are based on real data.

## Pre-Optimization Performance Data

> add data here
| Route | Time (ms) |
| ---------------------------------------- | ------- |
| /users/create | 102.8 |
| /users/platform (POST) | 395.8 |
| /users/delete/{user_id} (POST) | 516.8 |
| | |
| /song/get_library/ (GET) | 60.2 |
| /song/add (POST) | 100.2 |
| /song/link/add (POST) | 64 |
| /song/{song_id}/remove (POST) | 695 |
| /song/{song_id}/play (GET) | 208.4 |
| | |
| /playlist/create (POST) | 70.8 |
| /playlist/{playlist_id}/songs/add (POST) | 64.8 |
| /playlist/{playlist_id}/play (GET) | 25890.4 |
| | |
| /ad/create (POST) | |

## Performance Tuning

Expand Down

0 comments on commit 2614a85

Please sign in to comment.