Logs: freenode/#haskell
| 2020-11-02 18:45:51 | → | justanotheruser joins (~justanoth@unaffiliated/justanotheruser) |
| 2020-11-02 18:45:55 | × | jakob_ quits (~textual@p200300f49f162200f40f209088e2d2f9.dip0.t-ipconnect.de) (Client Quit) |
| 2020-11-02 18:46:01 | <daydaynatation> | list operations are so much faster than vector |
| 2020-11-02 18:46:23 | <koz_> | Not something we hear often. |
| 2020-11-02 18:46:58 | × | UpstreamSalmon quits (uid12077@gateway/web/irccloud.com/x-crbxrpluwxladazf) (Quit: Connection closed for inactivity) |
| 2020-11-02 18:47:39 | × | khaladrogo_lite quits (~khaladrog@2405:204:5217:6256:f1ab:1e40:6c9b:8f55) (Quit: Leaving) |
| 2020-11-02 18:47:51 | × | khaladrogo quits (~khaladrog@2405:204:5217:6256:f1ab:1e40:6c9b:8f55) (Remote host closed the connection) |
| 2020-11-02 18:48:12 | <daydaynatation> | I'm a beginner in Haskell, the code is very awkard |
| 2020-11-02 18:48:46 | <davean> | Oh, well |
| 2020-11-02 18:48:56 | <davean> | Thats not an IO action really that you're doign there? |
| 2020-11-02 18:49:19 | <davean> | What you were *trying* to time was a pure computation. |
| 2020-11-02 18:49:49 | <daydaynatation> | I did generate a random number in the action |
| 2020-11-02 18:49:59 | <davean> | Yah, and that part gets computed, but thats not where the time is taken |
| 2020-11-02 18:50:16 | <tomsmeding> | @hackage criterion-measurement |
| 2020-11-02 18:50:17 | <lambdabot> | https://hackage.haskell.org/package/criterion-measurement |
| 2020-11-02 18:50:18 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 272 seconds) |
| 2020-11-02 18:50:22 | <davean> | The IO part *does* get executed here, but the sorting is optional depending on if oyu use it or not because its not IO |
| 2020-11-02 18:50:25 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2020-11-02 18:50:37 | <tomsmeding> | (which depends on aeson.......) |
| 2020-11-02 18:50:48 | → | Saukk joins (~Saukk@2001:998:f9:2914:1c59:9bb5:b94c:4) |
| 2020-11-02 18:51:04 | <davean> | I should see how long it would take me to convert the parts of hackage I sit on top of off of aeson. |
| 2020-11-02 18:51:24 | <davean> | I bet I could do that in ... 30 hours? Thats a lot of code and a fairly significant change really, but it seems quite doable. |
| 2020-11-02 18:51:25 | → | dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) |
| 2020-11-02 18:51:25 | <daydaynatation> | ok..let me digest. but do you understand why the list operations is quicker? |
| 2020-11-02 18:51:36 | <davean> | daydaynatation: yes, I do, because you never check that its sorted. |
| 2020-11-02 18:51:49 | <davean> | so *all* you're really testing is that it generates a random list |
| 2020-11-02 18:51:53 | <davean> | Which is the IO part |
| 2020-11-02 18:52:58 | <davean> | I have to go, or I'd comment on the code and ways to improve it :/ |
| 2020-11-02 18:53:16 | <daydaynatation> | thanks! |
| 2020-11-02 18:53:27 | <tomsmeding> | it's not accurate, but for this you can kind of see IO as being defined as 'data IO a = IO a' |
| 2020-11-02 18:53:35 | → | stef204 joins (~stef204@unaffiliated/stef-204/x-384198) |
| 2020-11-02 18:53:39 | × | knupfer quits (~Thunderbi@200116b82c45b300e8f677624452dee1.dip.versatel-1u1.de) (Ping timeout: 268 seconds) |
| 2020-11-02 18:53:51 | → | ransom joins (~c4264035@undergraduate-jvossen-9690.mines.edu) |
| 2020-11-02 18:53:55 | <tomsmeding> | that 'r <- action' evaluates 'r' to WHNF (do you know that term?), which is the IO constructor, but not the 'a' inside |
| 2020-11-02 18:54:17 | <tomsmeding> | so if you force 'fmap f (some IO action)', then that f is never evaluated yet |
| 2020-11-02 18:54:38 | <tomsmeding> | since the head (as in WHNF) of the result is already evaluated to IO |
| 2020-11-02 18:54:40 | × | refried_ quits (~textual@pool-108-20-26-90.bstnma.fios.verizon.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
| 2020-11-02 18:54:51 | <dminuoso> | Im not convinced that IO model is helpful in any way. |
| 2020-11-02 18:54:57 | <dminuoso> | It's very suggestive in the wrong ways |
| 2020-11-02 18:55:05 | → | Axma45768 joins (~Axman6@pdpc/supporter/student/Axman6) |
| 2020-11-02 18:55:08 | <tomsmeding> | okay maybe it is |
| 2020-11-02 18:55:18 | <davean> | Also, I want to point out that the action tested here *does not use a reason to be IO* |
| 2020-11-02 18:55:26 | → | mmalecki joins (~mmalecki@154.13.1.56) |
| 2020-11-02 18:55:34 | <davean> | Random number generation does not require IO |
| 2020-11-02 18:55:40 | <daydaynatation> | If i leave IO out of it, how do people time pure code? |
| 2020-11-02 18:55:49 | <davean> | daydaynatation: the timing needs to be in IO |
| 2020-11-02 18:55:50 | <dminuoso> | My referred analogy of `IO T` is `list of assembly instruction that, if executed, would produce a result of type T` |
| 2020-11-02 18:55:56 | <tomsmeding> | (fixing it is easy, by the way: either force 'r' using Control.DeepSeq.force, or use a primitive from criterion-measurement) |
| 2020-11-02 18:56:14 | <dminuoso> | Which seems to work rather well, and helps accept IO as being something opaque |
| 2020-11-02 18:56:25 | <davean> | tomsmeding: those will make the list variant look worse performance wise than they REALLY are. |
| 2020-11-02 18:56:30 | <davean> | erg, have to go. |
| 2020-11-02 18:56:40 | <geekosaur> | we generally use the criterion package, which knows how to work around laziness doing things like deferring all computation you thought had already taken place into the timed part |
| 2020-11-02 18:56:48 | <tomsmeding> | davean: not if you only force the final result :p |
| 2020-11-02 18:57:15 | <tomsmeding> | geekosaur: or if you want to only use the timing primitives and not the whole benchmarking+reporting suite around it, use the criterion-measurement package :p |
| 2020-11-02 18:57:27 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-02 18:57:46 | × | Axman6 quits (~Axman6@pdpc/supporter/student/Axman6) (Ping timeout: 246 seconds) |
| 2020-11-02 18:58:22 | × | mupf quits (~micha@v22017094964653601.ultrasrv.de) (Quit: WeeChat 2.9) |
| 2020-11-02 18:59:13 | → | mupf joins (~micha@v22017094964653601.ultrasrv.de) |
| 2020-11-02 19:00:33 | <sm[m]> | Aha.. SPJ "The Launch of the Haskell Foundation", streaming on youtube in 40h - https://www.reddit.com/r/haskell/comments/jml10v/haskell_exchange_2020_opening_keynote_the_launch/ |
| 2020-11-02 19:00:35 | <tomsmeding> | daydaynatation: fix 1: https://paste.tomsmeding.com/165QyyNN |
| 2020-11-02 19:01:42 | <daydaynatation> | cool! thx let me check |
| 2020-11-02 19:01:58 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 256 seconds) |
| 2020-11-02 19:03:24 | × | berberman_ quits (~berberman@unaffiliated/berberman) (Ping timeout: 240 seconds) |
| 2020-11-02 19:03:33 | → | berberman joins (~berberman@unaffiliated/berberman) |
| 2020-11-02 19:03:36 | → | knupfer joins (~Thunderbi@200116b82c45b300e014d1b214daaf45.dip.versatel-1u1.de) |
| 2020-11-02 19:05:23 | × | kuribas quits (~user@ptr-25vy0i9b0d7gsf4mjtv.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3)) |
| 2020-11-02 19:05:49 | × | ransom quits (~c4264035@undergraduate-jvossen-9690.mines.edu) (Quit: Textual IRC Client: www.textualapp.com) |
| 2020-11-02 19:05:51 | → | juuandyy joins (~juuandyy@90.166.144.65) |
| 2020-11-02 19:06:30 | <daydaynatation> | it does look better! but the two tests take similar time |
| 2020-11-02 19:06:48 | <daydaynatation> | tomsmeding: let me dig deeper. thx! |
| 2020-11-02 19:07:02 | × | wroathe quits (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net) (Quit: leaving) |
| 2020-11-02 19:07:50 | <tomsmeding> | daydaynatation: or using criterion-measurement: https://paste.tomsmeding.com/uSMMDfGo |
| 2020-11-02 19:08:55 | <tomsmeding> | in the end it does basically the same thing in this case, but the advantage is that 1. you get more info than just the time (see the rest of the Measured data type), 2. the '1' can be increased to repeat the measurement, and 3. you're forced to choose how strictly you want to evaluate the result, here using nfIO |
| 2020-11-02 19:08:56 | × | mmohammadi9812 quits (~mmohammad@188.210.118.100) (Quit: Quit) |
| 2020-11-02 19:08:58 | → | conal joins (~conal@198.8.81.68) |
| 2020-11-02 19:09:07 | → | acidjnk_new joins (~acidjnk@p200300d0c72260501db9c4f6165b2eaf.dip0.t-ipconnect.de) |
| 2020-11-02 19:09:29 | <tomsmeding> | and if you want nice reports and fancy stuff, use the full criterion library :p |
| 2020-11-02 19:09:34 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-02 19:10:34 | <daydaynatation> | Thanks tomsmeding |
| 2020-11-02 19:10:35 | <tomsmeding> | if you'd have a normal pure value, not an IO action, you could use 'nf' instead of 'nfIO' |
| 2020-11-02 19:10:58 | <tomsmeding> | good luck :) |
| 2020-11-02 19:11:47 | <daydaynatation> | tomsmeding: I don't see criterion code in your last paste |
| 2020-11-02 19:12:05 | <daydaynatation> | tomsmeding: Perhaps wrong diff? |
| 2020-11-02 19:12:08 | <tomsmeding> | oh crap yes :') |
| 2020-11-02 19:12:52 | <tomsmeding> | https://paste.tomsmeding.com/z3fyxybh |
| 2020-11-02 19:12:58 | <tomsmeding> | (ignore the Lib/Main test/main replacements) |
| 2020-11-02 19:13:19 | <tomsmeding> | (using 'measure' doesn't return the actual function value, hence I removed that) |
| 2020-11-02 19:13:44 | <daydaynatation> | tomsmeding: Always a pleasure to learn a new Lib! |
| 2020-11-02 19:14:26 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 264 seconds) |
| 2020-11-02 19:15:21 | × | berberman quits (~berberman@unaffiliated/berberman) (Read error: Connection reset by peer) |
| 2020-11-02 19:15:34 | → | berberman_ joins (~berberman@unaffiliated/berberman) |
| 2020-11-02 19:16:44 | × | geekosaur quits (82659a09@host154-009.vpn.uakron.edu) (Ping timeout: 245 seconds) |
| 2020-11-02 19:17:01 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 264 seconds) |
| 2020-11-02 19:17:42 | → | Tario joins (~Tario@201.192.165.173) |
| 2020-11-02 19:18:24 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2020-11-02 19:21:44 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-11-02 19:22:56 | × | Rudd0 quits (~Rudd0@185.189.115.103) (Ping timeout: 256 seconds) |
| 2020-11-02 19:23:25 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-11-02 19:25:15 | × | tauli quits (~textual@185.213.155.161) (Quit: Textual IRC Client: www.textualapp.com) |
| 2020-11-02 19:26:33 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 260 seconds) |
All times are in UTC.