speed up populating the importfeed database
authorJoey Hess <joeyh@joeyh.name>
Wed, 25 Oct 2023 17:00:17 +0000 (13:00 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 25 Oct 2023 17:00:17 +0000 (13:00 -0400)
commitc9866d2164be349895d7d92cc1f64c48235a6730
tree711536c75e02cd37a20db57c600009d36be89f35
parentaaeadc422acbe7ca1055a8af525ed463246cac45
speed up populating the importfeed database

Avoid conversion from ByteString to String for urls that will just be
converted right back to ByteString to go into the database.

Also setTempUrl is not used by importfeed, so avoid checking for temp
urls in this code path.

This benchmarks as only a small improvement. From 2.99s to 2.78s
when populating a database with 33k urls.

Note that it does not seem worth replacing URLString with URLByteString
generally, because the ways urls are used all entails either parseURI,
which takes a string, or passing a parameter to eg curl, which also is
currently a string.

Sponsored-by: Leon Schuermann on Patreon
Database/ImportFeed.hs
Logs/Web.hs