Logs: liberachat/#haskell
| 2021-06-16 05:17:09 | <sshine> | ah, okay. |
| 2021-06-16 05:17:16 | <sshine> | I've most often missed it. |
| 2021-06-16 05:17:51 | <sshine> | they seem to be defined here: https://hackage.haskell.org/package/base-4.15.0.0/docs/src/Numeric.html#readOct -- that is, using ReadP parsers from Text.Read.Lex: https://hackage.haskell.org/package/base-4.15.0.0/docs/src/Text-Read-Lex.html#readOctP |
| 2021-06-16 05:18:16 | → | mengu joins (~mengu@c188-150-13-129.bredband.tele2.se) |
| 2021-06-16 05:18:29 | <sshine> | those combinators actually seem to have been built with flexibility for more number bases. |
| 2021-06-16 05:18:29 | × | Codaraxis quits (~Codaraxis@s13490149139.blix.com) (Read error: Connection reset by peer) |
| 2021-06-16 05:18:33 | × | hpc quits (~juzz@ip98-169-35-13.dc.dc.cox.net) (Ping timeout: 268 seconds) |
| 2021-06-16 05:18:57 | × | theneo quits (~sakthig@122.181.48.188) (Quit: Client closed) |
| 2021-06-16 05:19:41 | → | hololeap joins (hololeap@user/hololeap) |
| 2021-06-16 05:20:26 | <mikko> | actually i'm having a hard time finding a language that doesn't have 0b11.. C, ruby, python, js, julia all have it |
| 2021-06-16 05:20:40 | → | mikoto-chan joins (~mikoto-ch@ip-213-49-189-31.dsl.scarlet.be) |
| 2021-06-16 05:21:03 | <mikko> | but i guess it's simple enough to define readBin with readInt |
| 2021-06-16 05:21:06 | <sshine> | interesting! I wonder if my memory is wrong. |
| 2021-06-16 05:21:10 | <sshine> | yeah :) |
| 2021-06-16 05:21:28 | <sshine> | :t Text.Read.Lex.readIntP 2 (`elem` "01") (\c -> ord c - ord '0') |
| 2021-06-16 05:21:29 | <lambdabot> | Num a => Text.ParserCombinators.ReadP.ReadP a |
| 2021-06-16 05:22:42 | × | mengu quits (~mengu@c188-150-13-129.bredband.tele2.se) (Ping timeout: 240 seconds) |
| 2021-06-16 05:23:44 | <sshine> | :t Text.ParserCombinators.ReadP.readP_to_S (Text.Read.Lex.readIntP 2 (`elem` "01") (\c -> ord c - ord '0')) |
| 2021-06-16 05:23:45 | <lambdabot> | Num a => ReadS a |
| 2021-06-16 05:23:54 | × | beka_ quits (~beka@104.193.170-244.PUBLIC.monkeybrains.net) (Ping timeout: 240 seconds) |
| 2021-06-16 05:24:08 | <sshine> | which is just an alias for 'String -> [(a, String)]': https://hackage.haskell.org/package/base-4.15.0.0/docs/GHC-Read.html#t:ReadS |
| 2021-06-16 05:24:27 | <mikko> | i went with readBin s = head [num | (num, "") <- readInt 2 (`elem` "01") digitToInt s] |
| 2021-06-16 05:25:18 | <sshine> | maybe readBin should be added. |
| 2021-06-16 05:30:41 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-06-16 05:32:04 | → | ddellacosta joins (~ddellacos@86.106.121.100) |
| 2021-06-16 05:32:25 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 2021-06-16 05:34:01 | → | Bartosz joins (~textual@24.35.90.211) |
| 2021-06-16 05:34:27 | × | rk04 quits (~rk04@user/rajk) (Quit: rk04) |
| 2021-06-16 05:35:14 | → | chomwitt joins (~Pitsikoko@2a02:587:dc02:b00:98b0:cd42:bd6f:8295) |
| 2021-06-16 05:36:39 | × | ddellacosta quits (~ddellacos@86.106.121.100) (Ping timeout: 244 seconds) |
| 2021-06-16 05:38:26 | → | qbt joins (~edun@user/edun) |
| 2021-06-16 05:38:54 | → | gvx joins (~david@softbank126019120204.bbtec.net) |
| 2021-06-16 05:39:46 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 2021-06-16 05:40:59 | × | acowley quits (~acowley@c-68-83-22-43.hsd1.nj.comcast.net) (Ping timeout: 244 seconds) |
| 2021-06-16 05:41:26 | → | _ht joins (~quassel@82-169-194-8.biz.kpn.net) |
| 2021-06-16 05:42:52 | → | acowley joins (~acowley@c-68-83-22-43.hsd1.nj.comcast.net) |
| 2021-06-16 05:44:40 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-06-16 05:46:35 | → | ixlun joins (~matthew@213.205.241.86) |
| 2021-06-16 05:48:42 | × | zangi quits (~azure@103.154.230.130) (Ping timeout: 240 seconds) |
| 2021-06-16 05:49:10 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 2021-06-16 05:50:26 | <dsal> | I wrote some code using scotty and have some unit tests using `testWithApplication` to bind to a port and then use wreq to make requests against http://localhost:[port]/. It's absurdly slow. Most of the time seems to be spent doing something related to base64 decoding down inside a PEM parser. Any idea what's going on here? |
| 2021-06-16 05:51:02 | <dsal> | Sucks because nothing in the profile is even code I want called, much less am trying to call. |
| 2021-06-16 05:51:18 | × | ixlun quits (~matthew@213.205.241.86) (Ping timeout: 264 seconds) |
| 2021-06-16 05:51:33 | <dsal> | Example top of profile: https://www.irccloud.com/pastebin/TvFpBoRp/sucks.prof |
| 2021-06-16 05:52:55 | <dminuoso> | Damn I recall that same problem when I was on macOS |
| 2021-06-16 05:54:30 | <dminuoso> | dsal: Just out of curiosity, what cost center generation do you use? |
| 2021-06-16 05:55:05 | <dsal> | Heh, I don't know what I'm doing here, just ran `stack test --profile` to see which of my dumb functions needed to be speed up. |
| 2021-06-16 05:58:14 | <dminuoso> | dsal: Can you try running getSystemCertificateStore in isolation? My memory is sketchy, but I think it's just a slow process. |
| 2021-06-16 05:58:36 | <dminuoso> | (Maybe the result is not cached properly due to the way your tests are set up) |
| 2021-06-16 05:59:06 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds) |
| 2021-06-16 06:00:52 | <dsal> | That returned quickly enough. I'm doing property tests making http requests into a server I brought up with `testWithApplication` -- I've got it down to 5 tests, but it might have up to 100 (*2) HTTP requests to make against the server. I'm running those concurrently, but that seems to be where all the time is. I can't tell if it's the client or the server from here. |
| 2021-06-16 06:01:56 | <dminuoso> | Perhaps you could grab `certificates`, modify `getSystemCertificateStore` to maybe log a line every time its called, vendor it, and observe? |
| 2021-06-16 06:02:11 | <dminuoso> | There's likely better options, so this is just a pragmatic idea |
| 2021-06-16 06:03:05 | <dsal> | The annoying part is that I'm not doing anything that should involve a certificate in the first place. |
| 2021-06-16 06:03:39 | <dminuoso> | Can you put out the profiling data in call tree shape? |
| 2021-06-16 06:03:44 | <dminuoso> | It should be obvious what calls it |
| 2021-06-16 06:04:17 | <dsal> | https://github.com/haskell/wreq/issues/128 <-- oh hey. I think someone's seen this before. |
| 2021-06-16 06:05:00 | → | Guest71 joins (~Guest71@host-79-36-63-89.retail.telecomitalia.it) |
| 2021-06-16 06:05:41 | → | ddellacosta joins (~ddellacos@86.106.121.100) |
| 2021-06-16 06:06:13 | <dminuoso> | As far as I can remember, the behavior seemed reasonable to me at the time. |
| 2021-06-16 06:06:27 | <dminuoso> | If you could provide a more detailed profiling graph that might be helpful |
| 2021-06-16 06:07:28 | <dminuoso> | (with the call free and perhaps with profiling-detail: all-functions) |
| 2021-06-16 06:07:54 | × | sbmsr quits (~pi@2600:1700:63d0:4830:7dbf:92d8:fd42:235d) (Ping timeout: 240 seconds) |
| 2021-06-16 06:08:57 | <dsal> | Here's the whole file. It's a bit big, but if you have a wide enough screen, you can make it out. :) https://usercontent.irccloud-cdn.com/file/r6Xu7kOR/shortening-test.prof |
| 2021-06-16 06:09:24 | <dminuoso> | hah it crashes my emacsclient! |
| 2021-06-16 06:09:30 | → | azeem joins (~azeem@dynamic-adsl-78-13-238-239.clienti.tiscali.it) |
| 2021-06-16 06:09:54 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds) |
| 2021-06-16 06:10:11 | <dsal> | I'm just using less -S |
| 2021-06-16 06:10:13 | × | ddellacosta quits (~ddellacos@86.106.121.100) (Ping timeout: 268 seconds) |
| 2021-06-16 06:10:25 | <dminuoso> | dsal: Ah I think I found it. |
| 2021-06-16 06:10:38 | <dminuoso> | Is it possible you create a new manager for each test? |
| 2021-06-16 06:10:58 | <dsal> | It's quite possible. I'm just using wreq in the most basic dumb way. |
| 2021-06-16 06:11:10 | <dminuoso> | https://hackage.haskell.org/package/http-client-0.7.8/docs/Network-HTTP-Client.html#v:newManager |
| 2021-06-16 06:11:28 | → | sbmsr joins (~pi@2600:1700:63d0:4830:7dbf:92d8:fd42:235d) |
| 2021-06-16 06:12:14 | <dminuoso> | newManager Network.HTTP.Client.Manager Network/HTTP/Client/Manager.hs:(107,1)-(134,18) 74862 253 0.0 0.0 45.1 44.3 |
| 2021-06-16 06:12:24 | → | mengu joins (~mengu@c188-150-13-129.bredband.tele2.se) |
| 2021-06-16 06:12:41 | <dminuoso> | So yeah. This is an expensive operation because it creates a full certificate store each time it seems. |
| 2021-06-16 06:12:59 | <dsal> | I'll see if the wreq session thing helps. |
| 2021-06-16 06:13:58 | <dsal> | Yeah, that's... significantly faster. |
| 2021-06-16 06:14:26 | <dsal> | OK. So I guess creating a new manager everytime implicitly by using wreq the dumb way is a bad idae. |
| 2021-06-16 06:15:12 | <dsal> | Cool, this is usably fast now. Thanks. :) |
| 2021-06-16 06:17:37 | × | mengu quits (~mengu@c188-150-13-129.bredband.tele2.se) (Ping timeout: 268 seconds) |
| 2021-06-16 06:18:15 | × | shredder quits (~shredder@user/shredder) (Ping timeout: 268 seconds) |
| 2021-06-16 06:18:22 | × | xff0x quits (~xff0x@2001:1a81:528b:ea00:a293:ef4f:1ed1:8444) (Remote host closed the connection) |
| 2021-06-16 06:18:39 | → | xff0x joins (~xff0x@2001:1a81:528b:ea00:47e2:5dd5:5231:1b1e) |
| 2021-06-16 06:19:21 | → | yd502_ joins (~yd502@180.168.212.6) |
| 2021-06-16 06:20:34 | × | yd502 quits (~yd502@180.168.212.6) (Ping timeout: 244 seconds) |
| 2021-06-16 06:21:55 | → | shredder joins (~shredder@user/shredder) |
| 2021-06-16 06:25:14 | → | Lycurgus joins (~juan@cpe-45-46-140-49.buffalo.res.rr.com) |
| 2021-06-16 06:25:18 | → | hpc joins (~juzz@ip98-169-35-13.dc.dc.cox.net) |
| 2021-06-16 06:25:32 | × | eight quits (~eight@user/eight) (Quit: leaving) |
| 2021-06-16 06:25:54 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-06-16 06:30:42 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds) |
| 2021-06-16 06:32:25 | × | shredder quits (~shredder@user/shredder) (Ping timeout: 272 seconds) |
| 2021-06-16 06:35:45 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 2021-06-16 06:35:57 | × | Lycurgus quits (~juan@cpe-45-46-140-49.buffalo.res.rr.com) (Quit: Exeunt) |
| 2021-06-16 06:36:19 | → | koishi_ joins (~koishi_@67.209.186.120.16clouds.com) |
| 2021-06-16 06:37:18 | → | shredder joins (~shredder@user/shredder) |
| 2021-06-16 06:37:44 | → | haskman joins (~haskman@223.179.143.114) |
| 2021-06-16 06:38:24 | → | ddellacosta joins (~ddellacos@86.106.121.100) |
All times are in UTC.