solve hw-9

This commit is contained in:
JamesFlare1212
2025-04-15 22:08:11 -04:00
parent 9ec5d3d32c
commit a109046498
17 changed files with 1498 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
HOMEWORK 9: Tiktok Trends
NAME: < insert name >
NAME: Jinshan Zhou
COLLABORATORS AND OTHER RESOURCES:
@@ -10,17 +10,21 @@ List the names of everyone you talked to about this assignment
LMS, etc.), and all of the resources (books, online reference
material, etc.) you consulted in completing this assignment.
< insert collaborators / resources >
A lot, like using Top K for better sorting. Difference IO cases (not useful).
StringCache (not useful). shared_ptr (not really help) and may websites, cases
that I don't remember anymore.
Remember: Your implementation for this assignment must be done on your
own, as described in "Academic Integrity for Homework" handout.
ESTIMATE OF # OF HOURS SPENT ON THIS ASSIGNMENT: < insert # hours >
ESTIMATE OF # OF HOURS SPENT ON THIS ASSIGNMENT: over 20 hr, 8 hr for complete
more than 10 hr just for optimization.
MISC. COMMENTS TO GRADER:
(optional, please be concise!)
The program is a bit messy. Since, I tried too many techniques. Some are broken
changes, so I have to add patch to it. Myself is also a bit lose to my code.
## Reflection and Self Assessment
@@ -32,5 +36,11 @@ What parts of the assignment did you find challenging? Is there anything that
finally "clicked" for you in the process of working on this assignment? How well
did the development and testing process go for you?
< insert reflection >
This was definitely the most challenging assignment I've ever seen, and the
hard part was identifying performance issues and optimizing them. It was not
easy, I used various tools like perf and found that the JSON part had the biggest
overhead. Optimizing it showed immediate results, but then I hit a bottleneck,
so I started using various schemes, and most of them didn't work. Then I had to
push back and design the business process from scratch and finally got inspired
by my professor to use unordered set to get the best performance
(last 0.1 seconds).