02:08:11 | * | derpydoo joined #nim |
02:43:30 | * | ensyde joined #nim |
02:48:04 | * | alexdaguy joined #nim |
04:46:50 | * | alexdaguy quit (Ping timeout: 260 seconds) |
05:08:31 | * | ntat joined #nim |
06:56:25 | * | ntat quit (Quit: leaving) |
07:07:49 | * | ntat joined #nim |
07:15:59 | * | ensyde quit (Ping timeout: 260 seconds) |
07:17:48 | * | ensyde joined #nim |
08:21:34 | * | ntat quit (Quit: leaving) |
10:05:56 | * | derpydoo quit (Quit: derpydoo) |
11:15:01 | * | ensyde quit (Ping timeout: 248 seconds) |
11:36:05 | * | ntat joined #nim |
12:50:06 | FromDiscord | <madonuko> sent a code paste, see https://paste.rs/1VltD |
12:52:04 | FromDiscord | <madonuko> wait, forgot to -d:release |
12:53:15 | FromDiscord | <madonuko> uh, still pretty slow even with -d:danger |
12:53:16 | * | ntat quit (Quit: leaving) |
13:11:34 | FromDiscord | <madonuko> so uhh I'm not sure if this is a good idea but I made it run multithreaded |
13:11:55 | FromDiscord | <madonuko> sent a code paste, see https://paste.rs/MvSyW |
13:18:34 | FromDiscord | <z1r343l2> What's syncio |
13:18:44 | FromDiscord | <janakali> try `seq[string]` instead of HashSet and then `lines.deduplicate()`, hashing every line is probably a lot slower |
13:19:24 | FromDiscord | <madonuko> In reply to @janakali "try `seq[string]` instead of": need to also sort |
13:19:45 | FromDiscord | <lainlaylie> what does the profiler say |
13:20:09 | FromDiscord | <madonuko> uh, I don't actually know how to use a profiler |
13:21:02 | FromDiscord | <lainlaylie> good opportunity to learn |
13:21:15 | FromDiscord | <lainlaylie> In reply to @z1r343l2 "What's syncio": https://nim-lang.github.io/Nim/syncio.html |
13:21:42 | FromDiscord | <lainlaylie> automatically imported by system module unless nimPreviewSlimSystem |
13:22:06 | FromDiscord | <madonuko> well my program kinda doesn't finish right now https://media.discordapp.net/attachments/371759389889003532/1355170082036121620/image.png?ex=67e7f3fd&is=67e6a27d&hm=19fee71a9bd1d45408e1215805b4733fede9a246c53082b79a8282945b1fae33& |
13:52:40 | FromDiscord | <lainlaylie> basically compile with --debugger:native and then use your typical c profiling tools |
13:55:01 | FromDiscord | <tapeda> Git Treeform/hotty is a convenient way too |
14:15:37 | * | coldfeet joined #nim |
14:30:08 | * | ntat joined #nim |
15:16:48 | * | xutaxkamay_ joined #nim |
15:17:29 | * | xutaxkamay quit (Read error: Connection reset by peer) |
15:17:45 | * | xutaxkamay_ is now known as xutaxkamay |
15:46:59 | FromDiscord | <__nycto__> I was doing some profiling and found that iterating over a `seq` in a `Table` was forcing the hash of the key to get double calculated, and creating a copy of the `seq` to do the iteration. I had to do some privateAccess and import shenanigans to fix it. But I'm hoping there is a better way that I just didn't see. Any ideas about how to improve this? https://github.com/Nycto/AHGrid/blob/main/src/private/util.nim |
15:58:13 | FromDiscord | <lainlaylie> sent a code paste, see https://paste.rs/Jnl4B |
16:20:43 | FromDiscord | <__nycto__> sent a code paste, see https://paste.rs/BkXMj |
16:21:53 | FromDiscord | <__nycto__> sent a code paste, see https://paste.rs/MhNAF |
16:46:37 | FromDiscord | <maxb0tbeep> is there a good way to store data in a similar way to a java 2d array? |
16:47:42 | FromDiscord | <maxb0tbeep> like `int[][] myArray = new int[3][3];` to make a 3x3 array |
16:47:47 | FromDiscord | <maxb0tbeep> is there an equivalent? |
16:48:30 | FromDiscord | <__nycto__> seq[seq[int]] is one way |
16:48:59 | FromDiscord | <__nycto__> array[3; array[3; int]] is another |
16:49:39 | FromDiscord | <__nycto__> If you’re doing matrix operations, though, you should use a lib like vmath |
16:50:59 | FromDiscord | <maxb0tbeep> alright, thanks |
17:37:39 | * | coldfeet quit (Quit: Lost terminal) |
17:46:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/FRz22 |
18:51:13 | FromDiscord | <threefour> I know there is an `{.inline.}` calling convention, but is there a way to inline at the call location, instead of for every call of a function? |
19:00:57 | Amun-Ra | "inline at call location"? |
19:28:25 | * | GnuYawk quit (Quit: The Lounge - https://thelounge.chat) |
19:28:45 | * | GnuYawk joined #nim |
19:41:39 | FromDiscord | <heysokam> In reply to @threefour "I know there is": nope. the syntax wouldn't have room to have it either |
19:42:06 | FromDiscord | <heysokam> you'd need to create a template or macro for it |
19:59:31 | FromDiscord | <.bobbbob> that's basically what a template is isnt it? |
20:00:32 | FromDiscord | <.bobbbob> or you could have the "function" be a template that gets inlined but then have a normal function thats a wrapper for the template if you want that |
20:00:38 | FromDiscord | <.bobbbob> sounds like premature optimization |
20:01:55 | FromDiscord | <threefour> Nah, just a theoretical question because Zig has that. But on second thought, Zig does comptime differently to where that's actually useful. |
20:22:23 | FromDiscord | <heysokam> In reply to @.bobbbob "that's basically what a": A template -always- inlines. he said he wants to inline only sometimes |
20:23:03 | FromDiscord | <Elegantbeef> The default convention inlines sometime |
20:23:03 | FromDiscord | <Elegantbeef> What does that even mean |
20:23:13 | FromDiscord | <heysokam> In reply to @threefour "Nah, just a theoretical": zig has `inline for`, but I'm not sure if it has inline function calls |
20:23:45 | FromDiscord | <heysokam> (edit) "In reply to @threefour "Nah, just a theoretical": zig has `inline for`, but I'm not sure if it has ... inline" added "in-place" |
20:23:53 | FromDiscord | <Elegantbeef> Isn't that loop unrolling? |
20:23:57 | FromDiscord | <heysokam> yea |
20:52:06 | * | ntat quit (Quit: leaving) |
21:00:31 | FromDiscord | <.bobbbob> In reply to @heysokam "A template -always- inlines.": I mean you put the code in the template, and when you want to inline it you "call" the template, but then you have a wrapper proc that just calls the template in it, so when you dont want to inline you call that |
21:03:14 | FromDiscord | <.bobbbob> but then gcc might deduplicate your code? 👀 |
21:05:18 | FromDiscord | <.bobbbob> actually does the nim .inline. pragma use C inline? because im under the impression inline isnt guarateed to inline anyways and you have to use attribute((always_inline)) to do that |
21:27:31 | * | zgasma joined #nim |
22:04:00 | FromDiscord | <leorize> it does use C's inline |
22:04:37 | FromDiscord | <leorize> it does, see\: https://ziglang.org/documentation/master/#toc-call↵(@heysokam) |
22:14:05 | FromDiscord | <heysokam> oh, didn't know that `@call` can take an inline parameter. ty leorize, good to know |
22:30:24 | FromDiscord | <__nycto__> sent a code paste, see https://paste.rs/ws4Ea |
22:33:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/I03nE |
22:33:43 | FromDiscord | <Elegantbeef> That should be identical to your solution |
22:33:51 | FromDiscord | <Elegantbeef> Though you need to do `entry[]` I guess |
22:37:09 | FromDiscord | <__nycto__> sent a code paste, see https://paste.rs/Vaq23 |
22:37:35 | FromDiscord | <Elegantbeef> `.addr[]` 😛 |
22:37:47 | FromDiscord | <Elegantbeef> What's a little cheekiness between friends |
22:38:51 | FromDiscord | <__nycto__> Ding ding, we have a winner 😄 |
22:39:02 | FromDiscord | <__nycto__> `==22902== Collected : 843149179` |
22:39:27 | FromDiscord | <__nycto__> Just gotta go take a quick shower |
22:39:41 | FromDiscord | <__nycto__> (edit) "Just gotta go take a quick shower ... " added "after checking that one in" |
22:41:11 | FromDiscord | <Elegantbeef> The ones that really win are the ones that don't have to see the code |
22:41:35 | FromDiscord | <Elegantbeef> I argue it's less sick then using `importutils` |
22:41:41 | FromDiscord | <__nycto__> Totally agreed |
22:41:46 | FromDiscord | <Elegantbeef> That module is a silly billy that should arguably never be used |
22:42:03 | FromDiscord | <__nycto__> If I get the time, I may submit a PR to add a new version of `withValue` |
22:42:41 | FromDiscord | <Elegantbeef> I think the thing is that it returns `ptr T` so it's never wise use it implicitly with non mutable |
22:44:08 | FromDiscord | <__nycto__> Interestingly, it's also just a _tooooch_ slower than the `importutils` version -- a difference of about 10,000,000 instructions in my benchmark code. Which is still pretty good |
22:44:09 | FromDiscord | <Elegantbeef> Nim needs borrowing and `let T` types pronto 😄 |
22:44:46 | FromDiscord | <Elegantbeef> Does your compiler have LTO? |
22:45:24 | FromDiscord | <Elegantbeef> Oh your code is mildly different |
22:45:42 | FromDiscord | <Elegantbeef> You did `>` and it does `>=` so perhaps that's the culprit, or just the fact it's taking an address |
22:45:59 | FromDiscord | <__nycto__> I'm using GCC, so it should |
23:33:56 | * | pbsds355 joined #nim |
23:35:24 | * | pbsds35 quit (Ping timeout: 252 seconds) |
23:35:25 | * | pbsds355 is now known as pbsds35 |