Commit graph

69 commits

Author SHA1 Message Date
TLSM
afe209d5d8
Eager load comments for post rendering.
GET /post/1/clever-unique-post-title-number-0
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |  942   |   0    |   1    |   0    |  943   |    921     |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 943 in 0.377s # request time in browser 17249ms

GET /post/1/clever-unique-post-title-number-0
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   58   |   0    |   1    |   0    |   59   |     35     |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 59 in 0.0423s # request time in browser 544ms

Also, fixes seed_db not populating top_comment_id on generated
comments. If you want to test locally with seed_db test data, you need
to reseed.
2022-11-28 17:47:54 -05:00
TLSM
4d22d9bce2
Eager load get_posts for submission_listings.
Ported in logic from upstream to use SQLAlchemy eager loading instead
of repeated queries when building a submission_listing. Adjusted
loaded relationships to include only those used on TheMotte.

Using test data from seed_db, before and after:

GET /
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   83   |   0    |   0    |   0    |   83   |     72     |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 83 in 0.031s

GET /
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   14   |   0    |   0    |   0    |   14   |     0      |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 14 in 0.00718s
2022-11-28 12:55:31 -05:00
TLSM
9953c5763c
Port get.py improvements from upstream.
Generally standardizes the get_* helpers:
 - Adds type hinting.
 - Deduplicates block property addition.
 - Respects `graceful` in more contexts.
 - More resilient to invalid user input / less boilerplate necessary
   at call-sites.
2022-11-28 12:36:04 -05:00
TLSM
c85cd469a1 Move post/comment ID boilerplate inside getters.
Borrows code from the upstream which has been working in production
reliably for ~months. Also, most of it was literally copy-pasted,
and the casted ID values aren't used later in the route functions.
2022-11-09 20:37:04 -06:00
FatherInire
b46ada9f72
Fix some deprecations and factor out a helper function (#387) 2022-10-27 22:15:48 -05:00
Ben Rog-Wilhelm
20fa9ce79f Move a bunch of moderation tools to admin level 2 2022-09-06 18:51:24 -05:00
Michael House
ea98d51fb2 Refactored path building and caching on /pp/ route 2022-06-08 06:53:15 -05:00
iro84657
b7da8b575a Add trailing LF to text files 2022-05-10 21:05:51 -04:00
Ben Rog-Wilhelm
1ee9c1bfa7
Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
Aevann1
42f70bc64e fdsfds 2022-04-15 18:28:08 +02:00
Aevann1
36afb28fe7 fart 2022-03-05 00:46:20 +02:00
Aevann1
ef52e5c0c7 fds 2022-02-26 21:01:32 +02:00
Aevann1
582135b954 fug 2022-02-26 16:21:07 +02:00
Aevann1
e324257dce fd 2022-02-24 10:28:13 +02:00
Aevann1
f3bb52e379 gf 2022-02-16 04:15:17 +02:00
Aevann1
06a36002a6 sdf 2022-02-15 00:50:27 +02:00
Aevann1
0a313c5aa5 dude subdramas lmao 2022-02-10 22:35:16 +02:00
Aevann1
53b1a2f862 sd 2022-02-04 10:59:12 +02:00
Aevann1
7719a3d074 zxc 2022-01-28 20:33:49 +02:00
Aevann1
c6ad62cfc8 sfd 2022-01-07 23:03:14 +02:00
Aevann1
ec20085f3e fd 2022-01-06 03:24:03 +02:00
Aevann1
d456aaa0c7 fsd 2022-01-02 02:06:46 +02:00
Aevann1
1a43b0dedc pins logic rework 2021-12-26 03:03:21 +02:00
Aevann1
2984e15fba fsdsfd 2021-12-17 19:55:11 +02:00
Aevann1
0e03dbe9ff sfdfsd 2021-12-05 20:52:03 +02:00
Aevann1
d6d0bcdd5b dfssdf 2021-11-30 20:22:31 +02:00
Aevann1
70e32150a8 dfsfds 2021-11-23 01:25:33 +02:00
Aevann1
ef0b875ebd gffg 2021-11-16 00:13:29 +02:00
Aevann1
90a6e7c53b redundant 2021-11-06 17:52:48 +02:00
Aevann1
9f16251750 dfsf 2021-11-06 02:33:32 +02:00
Aevann1
8dad770d88 fse 2021-11-02 13:54:04 -07:00
Aevann1
234401f351 fds 2021-11-02 13:33:36 -07:00
Aevann1
2265d60b22 fd 2021-10-15 16:08:27 +02:00
Aevann1
002e55476c gdfsd 2021-10-08 04:14:54 +02:00
Aevann1
99701e26aa df 2021-10-02 21:07:30 +02:00
Aevann1
4fb654a56a dfssfd 2021-10-02 13:34:37 +02:00
Aevann1
d3f080a2a8 hfghf 2021-09-30 21:40:33 +02:00
Aevann1
4b27cbad1c dfs 2021-09-28 21:45:17 +02:00
Aevann1
99062be8d3 fgg4 2021-09-28 21:39:51 +02:00
Aevann1
7c0b0fc413 sex 2021-09-22 20:36:03 +02:00
Aevann1
ef9a3d539d Revert "fdfd"
This reverts commit 3737c41a08.
2021-09-17 14:07:17 +02:00
Aevann1
3737c41a08 fdfd 2021-09-17 14:04:36 +02:00
Aevann1
6cc19ce02a sfd 2021-09-17 10:29:05 +02:00
Aevann1
0a769c7d4b hgh 2021-09-14 20:18:28 +02:00
Aevann1
d253bcc6af fd 2021-09-14 19:35:24 +02:00
Aevann1
c16f16d18b Revert "fd"
This reverts commit 549f28fb83.
2021-09-09 16:15:27 +02:00
Aevann1
549f28fb83 fd 2021-09-09 16:13:15 +02:00
Aevann1
1781d04767 dfdf 2021-08-31 19:00:57 +02:00
Aevann1
8a9b7d505e fddf 2021-08-31 18:59:48 +02:00
Aevann1
25b2a65580 fdfd 2021-08-14 04:29:17 +02:00