Repository navigation
Commit 94bfd24
Fetch paper sources concurrently instead of one at a time
The daily pull was almost entirely blocked on network waits taken in series.
Measured on the same query (4 arXiv categories + 12 journals): 488.57s before,
98.95s after -- 4.9x, about six and a half minutes saved per pull. Through the
GUI a real pull now completes in 29s.
Four levels were serial:
- The five sources (arXiv, OpenReview, journals, Semantic Scholar, custom RSS)
ran one after another, so wall clock was their sum -- journals alone took 91s
while arXiv sat idle. They now run together, each still failing in isolation.
- arXiv categories were fetched one per request in a loop: 13.13s for four
against ~1.07s for one, now 0.73s (18x). The fetcher holds no shared mutable
state and already degrades on 429.
- Journals were fetched one publisher at a time (91.66s for twelve).
- Within a single journal, every article's detail page was fetched serially,
which dominated that journal's runtime (Science 48s, Science Advances 60s for
ten papers). Now 25s and 45s. The remainder is the publishers' own latency:
a single detail fetch has a ~5.1s median, so this is near the floor rather
than something more workers would fix.
Embedding batches were also serial: 120 uncached texts took 126.52s, now 34.54s
(3.7x). The failure path is unchanged -- a raising request still falls back to
hash embeddings for every missing index and flips provider/model, verified
directly, because silently returning holes would corrupt scoring.
Ordering is preserved everywhere by using executor.map rather than as_completed:
downstream dedup keeps the first occurrence, so arXiv must still win over a later
journal copy of the same paper. A test finishes work in reverse order to catch a
regression back to completion-ordered collection.
Concurrency is bounded and tunable rather than unlimited, since these are
polite-use endpoints: PAPERFLOW_JOURNAL_CONCURRENCY (6, across publishers),
PAPERFLOW_JOURNAL_DETAIL_CONCURRENCY (4, deliberately lower because it hits one
host), PAPERFLOW_EMBED_CONCURRENCY (4, since 429s here would trip the hash
fallback and quietly degrade recommendations), and the existing
PAPERFLOW_MAX_CONCURRENCY for arXiv. Single-item work skips the pool entirely.
Journal entry collection now gathers candidates before fetching details, so the
per-journal limit is applied to accepted papers after _skip filtering, with a
small headroom so concurrent detail fetching cannot leave a result short.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 09a90a6 commit 94bfd24
4 files changed
Lines changed: 383 additions & 68 deletions
File tree
- deployments/feishu/daily-push-agent
- skills
- embedding/scripts
- journal-fetcher/scripts
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
1206 | | - | |
1207 | 1206 | | |
1208 | | - | |
| 1207 | + | |
| 1208 | + | |
1209 | 1209 | | |
1210 | 1210 | | |
1211 | 1211 | | |
| |||
1227 | 1227 | | |
1228 | 1228 | | |
1229 | 1229 | | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
1230 | 1244 | | |
1231 | 1245 | | |
1232 | 1246 | | |
| |||
1309 | 1323 | | |
1310 | 1324 | | |
1311 | 1325 | | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | 1326 | | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
1331 | 1339 | | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1338 | 1346 | | |
1339 | | - | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1340 | 1352 | | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | | - | |
1347 | | - | |
1348 | | - | |
1349 | | - | |
1350 | | - | |
| 1353 | + | |
1351 | 1354 | | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
1352 | 1359 | | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
1356 | | - | |
1357 | | - | |
1358 | | - | |
1359 | | - | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
1360 | 1382 | | |
1361 | 1383 | | |
1362 | 1384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
507 | 508 | | |
508 | 509 | | |
509 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
510 | 528 | | |
511 | 529 | | |
512 | 530 | | |
| |||
523 | 541 | | |
524 | 542 | | |
525 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
526 | 560 | | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
536 | 574 | | |
537 | 575 | | |
538 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
136 | 142 | | |
137 | 143 | | |
138 | 144 | | |
| |||
1206 | 1212 | | |
1207 | 1213 | | |
1208 | 1214 | | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1209 | 1218 | | |
1210 | 1219 | | |
1211 | 1220 | | |
1212 | 1221 | | |
1213 | 1222 | | |
1214 | 1223 | | |
1215 | 1224 | | |
1216 | | - | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1217 | 1231 | | |
1218 | 1232 | | |
1219 | 1233 | | |
| |||
1227 | 1241 | | |
1228 | 1242 | | |
1229 | 1243 | | |
1230 | | - | |
| 1244 | + | |
1231 | 1245 | | |
1232 | 1246 | | |
1233 | 1247 | | |
| |||
1238 | 1252 | | |
1239 | 1253 | | |
1240 | 1254 | | |
1241 | | - | |
1242 | | - | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1243 | 1277 | | |
1244 | 1278 | | |
1245 | | - | |
1246 | | - | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
1247 | 1282 | | |
1248 | 1283 | | |
1249 | 1284 | | |
| |||
1350 | 1385 | | |
1351 | 1386 | | |
1352 | 1387 | | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
1353 | 1422 | | |
1354 | 1423 | | |
1355 | 1424 | | |
| |||
1379 | 1448 | | |
1380 | 1449 | | |
1381 | 1450 | | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
1389 | 1477 | | |
1390 | 1478 | | |
1391 | 1479 | | |
| |||
0 commit comments