5 Jan 2023 |
neoabs | ah ok | 19:37:12 |
neoabs | test2 seems optimal | 19:37:43 |
neoabs | your | 19:37:47 |
neoabs | I think it deserves a thread | 19:39:34 |
neoabs | on discourse | 19:39:37 |
neoabs | next level: pmap | 19:40:03 |
Andreas Weh | Exactly, this is my issue. It is by far the fastes but doesn't allow for views (SubArrays ). I would prefer, pulling the padding out of the function and just pass the view, better encapsulating the logic (at least for my use case). | 19:40:06 |
Andreas Weh | * Exactly, this is my issue. It is by far the fastest but doesn't allow for views (SubArrays ). I would prefer, pulling the padding out of the function and just pass the view, better encapsulating the logic (at least for my use case). | 19:40:25 |
Andreas Weh | At least for large arrays, test3 seems like an acceptable way to allow views. Like I said, the code is borrowed from an GitHub issue. | 19:41:37 |
neoabs | views are not meant to be used as primary object. They are just to speed up / free up memomory. In your case they are simply obsolete. also
| 19:42:03 |
Andreas Weh | This is exactly the point. I want to use views to avoid copies. This however slows down my code, as count is slow.
So I had to refactor my whole code base, moving the padding within the function. This obfuscates my code, so I am looking for a way to have fast counting on views. I use views instead of slices which copies exactly because this code is performance critical | 19:44:21 |
Andreas Weh | But thanks for the input | 19:44:49 |
neoabs | if i undestand corretly sum is implemented in such a way that if it is defined over collections etc it does not generate collection and then callculates sum but callculcates sum while generateing subsequent elkements. That means using for ans other iterative generators are optimal | 19:50:15 |
neoabs | In reply to @wehandre:matrix.physik.uni-augsburg.de This is exactly the point. I want to use views to avoid copies. This however slows down my code, as count is slow. So I had to refactor my whole code base, moving the padding within the function. This obfuscates my code, so I am looking for a way to have fast counting on views. I use views instead of slices which copies exactly because this code is performance critical but your test 2 does not make any allocations? plus functions are in local scope and after execution insides are deleted | 19:52:16 |
Andreas Weh | There are no allocations, as a generator is used inside the loop. | 19:53:17 |
8 Jan 2023 |
| Harpocrate joined the room. | 17:22:16 |
14 Jan 2023 |
| bzbzbz1 joined the room. | 21:57:51 |
16 Jan 2023 |
| @noahaon:matrix.org left the room. | 22:01:18 |
18 Jan 2023 |
| osaut joined the room. | 17:09:55 |
| @chepyrka:nitro.chat removed their profile picture. | 20:47:40 |
| @chepyrka:nitro.chat removed their display name chepyrka. | 20:47:44 |
| @chepyrka:nitro.chat left the room. | 20:47:56 |
20 Jan 2023 |
| mikwee changed their profile picture. | 19:26:59 |
21 Jan 2023 |
| tecosaur joined the room. | 03:20:30 |
23 Jan 2023 |
| kuniberterino joined the room. | 21:14:25 |
26 Jan 2023 |
| heday joined the room. | 20:29:28 |
28 Jan 2023 |
| playback2396 joined the room. | 09:55:03 |
| @thinking_is_hard:matrix.org left the room. | 19:23:49 |
30 Jan 2023 |
| dillid joined the room. | 15:29:51 |
31 Jan 2023 |
| Jacob joined the room. | 18:27:53 |