companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
xgqt has quit [Ping timeout: 240 seconds]
xgqt has joined #ocaml
raskol has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has quit [Ping timeout: 244 seconds]
raskol has quit [Ping timeout: 276 seconds]
TakinOver has joined #ocaml
Sankalp has quit [Ping timeout: 272 seconds]
Sankalp has joined #ocaml
rgrinberg has joined #ocaml
TakinOver has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
TakinOver has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.5]
raskol has joined #ocaml
raskol has quit [Quit: Lost terminal]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zebrag has quit [Quit: Konversation terminated!]
bobo_ has joined #ocaml
spip has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
perrierjouet has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
chrisz has quit [Ping timeout: 240 seconds]
dextaa has joined #ocaml
chrisz has joined #ocaml
fds has quit [Ping timeout: 272 seconds]
azimut has quit [Ping timeout: 268 seconds]
xd1le has joined #ocaml
williewillus has quit [Quit: Leaving]
fds has joined #ocaml
fds has quit [Remote host closed the connection]
fds has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
Tuplanolla has joined #ocaml
salkin has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
orbifx has joined #ocaml
salkin has quit [Quit: salkin]
<orbifx> o/
salkin has joined #ocaml
salkin has quit [Client Quit]
salkin has joined #ocaml
Haudegen has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
adanwan has quit [Ping timeout: 268 seconds]
adanwan has joined #ocaml
xd1le has quit [Quit: xd1le]
noonien645 has joined #ocaml
noonien64 has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
adanwan has quit [Ping timeout: 268 seconds]
adanwan_ has joined #ocaml
salkin has quit [Quit: salkin]
adanwan_ has quit [Remote host closed the connection]
adanwan has joined #ocaml
orbifx has quit [Ping timeout: 268 seconds]
TakinOver has quit [Ping timeout: 272 seconds]
QDX45_ has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
dextaa has quit [Read error: Connection reset by peer]
dextaa has joined #ocaml
rgrinberg has joined #ocaml
spip has joined #ocaml
bobo_ has quit [Ping timeout: 272 seconds]
QDX45_ has quit [Ping timeout: 240 seconds]
QDX45_ has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
salkin has joined #ocaml
daimrod1 is now known as daimrod
zebrag has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
azimut has joined #ocaml
neiluj has joined #ocaml
<neiluj> Hi! Is an Array.init size f with some computation f takes as much time as the same initialization but in C?
<neiluj> the best way would be to try it, but curious if you have an opinion on it
<companion_cube> what do you mean by initialization in C?
<neiluj> malloc of the buffer (Array.init allocates on the heap I suppose), then fill it with a loop with the computation done by f
<companion_cube> but C cannot really represent `Array.init`
<companion_cube> I mean, it's kind of comparing apples and oranges
<neiluj> thanks, yes they are not the same but I try to see if replacing some OCaml code with equivalent C code is worth it
<neiluj> but I think that the OCaml code is already very fast, so I should focus on other optimizations
<companion_cube> yes, very likely
<neiluj> I <3 OCaml for that
rgrinberg has joined #ocaml
williewillus has joined #ocaml
bartholin has quit [Quit: Leaving]
<d_bot> <darrenldl> from experience it only really makes sense to introduce c when you need to crunch numbers in very tight loops
<neiluj> thanks darrenld! tight=small?
<d_bot> <darrenldl> roughly so
<d_bot> <darrenldl> and many iterations
<d_bot> <darrenldl> say in 10k+ range, where you want clang/gcc (aggressive) optimisations to take place etc
<neiluj> okay, in my case I'm iterating on arrays of length 128-256 with costly operations at each step
Sankalp has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
Sankalp has joined #ocaml
williewillus has quit [Quit: Leaving]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has joined #ocaml
rgrinberg has joined #ocaml
<neiluj> does Array.get return a fresh copy or a reference? looks like the former
<octachron> Array.get returns a value (aka a pointer to a block or an integer).
<neiluj> thanks, weird, trying to replace this h.(i) <- add h.(i) n by add_inplace h.(i) n which is supposed to write the addition h.(i)+n to h.(i)
<neiluj> but add_inplace doesn't compute the correct values
<d_bot> <jumpnbrownweasel> can you give the relevant code for add_inplace? normally an array and an index would have to be passed to a function that will modify the element at that index.
azimut has quit [Quit: ZNC - https://znc.in]
adanwan has quit [Ping timeout: 268 seconds]
azimut has joined #ocaml
adanwan has joined #ocaml
<dh`> references are a different type, and you can't construct references that make existing values mutable (even, AFAICR, mutable entries in arrays or records)
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jpds has quit [Ping timeout: 268 seconds]
<neiluj> wow, just by removing some allocations by writing in buffers, I just got a 1.4x improment in speed (didn't check memory consumption)
<neiluj> it's uglier tho
jpds has joined #ocaml
qwr has quit [Ping timeout: 272 seconds]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
jpds1 has joined #ocaml
jpds has quit [Ping timeout: 268 seconds]
neiluj has quit [Quit: Leaving]
fastru has joined #ocaml
salkin has quit [Quit: salkin]
rgrinberg has joined #ocaml
xgqt has quit [Ping timeout: 240 seconds]
xgqt has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
jpds1 has quit [Remote host closed the connection]
jpds1 has joined #ocaml
andreypopp has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 244 seconds]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
chrisz has quit [Ping timeout: 240 seconds]
chrisz has joined #ocaml