companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 248 seconds]
waleee has quit [Ping timeout: 260 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 252 seconds]
pi3ce has quit [Ping timeout: 276 seconds]
pi3ce has joined #ocaml
mjs22 has joined #ocaml
mjs22 has quit [Client Quit]
mbuf has joined #ocaml
YuGiOhJCJ has joined #ocaml
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 265 seconds]
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
bartholin has joined #ocaml
bartholin has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 272 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 246 seconds]
cr1901_ has joined #ocaml
cr1901 has quit [Ping timeout: 252 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 265 seconds]
dawids has joined #ocaml
alexherbo2 has joined #ocaml
gdiazlo_caml has joined #ocaml
bartholin has quit [Quit: Leaving]
tomku has quit [Ping timeout: 264 seconds]
tomku has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 246 seconds]
gdiazlo_caml has joined #ocaml
olle has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 276 seconds]
Serpent7776 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
gdiazlo_caml has joined #ocaml
Leonidas_ is now known as Leonidas
Leonidas is now known as Guest7697
Guest7697 has quit [Changing host]
Guest7697 has joined #ocaml
Guest7697 is now known as Leonidas
dawids has quit [Quit: Leaving]
gdiazlo_caml has quit [Ping timeout: 246 seconds]
<adrien> on ocaml 4, if I run two native threads, they will block if they both need to allocate or when the GC needs to run (when the code reaches an allocation point), and nothing else, right?*
<adrien> in which case, I guess a subsequent question is whether this allocates: Int32.to_int (Int32.shift_right_logical (Murmur3.hash32 (Bigstringaf.substring ba ~off ~len:check_length)) 8)
<adrien> especially the int32 handling
<adrien> (also, xxhash in opam is outdated and doesn't have a to_hex function that exists in more recent versions, and AFAICT, has no way to get the value out!)
<Leonidas> I am wondering, why does Format.set_margin Int.max_int not do anything when I use `Format.asprintf`?
<Leonidas> Format.printf "@[<hov 2>This is a long text that I want to print aaa bbb@ ccc ddd eee @[<hov>fff gg hh iii jjjj@] kkk lll mmm n o@]";;
<Leonidas> This gets affected by `set_margin`
<Leonidas> Format.asprintf "@[<hov 2>This is a long text that I want to print aaa bbb@ ccc ddd eee @[<hov>fff gg hh iii jjjj@] kkk lll mmm n o@]";;
<Leonidas> This always gets me the `\n`, unless I start with `%a` and add `Format.pp_set_margin Int.max_int`
gdiazlo_caml has joined #ocaml
<discocaml> <otini_> > on ocaml 4, if I run two native threads, they will block if they both need to allocate or when the GC needs to run (when the code reaches an allocation point), and nothing else, right?*
<discocaml> <otini_> adrien: yeah
gdiazlo_caml has quit [Ping timeout: 248 seconds]
<discocaml> <otini_> > in which case, I guess a subsequent question is whether this allocates: Int32.to_int (Int32.shift_right_logical (Murmur3.hash32 (Bigstringaf.substring ba ~off ~len:check_length)) 8)
<discocaml> <otini_> good question
<discocaml> <otini_> int32s are boxed, no question about that
<discocaml> <otini_> and I’m pretty sure Flambda does some allocation removal
<discocaml> <otini_> i’m not entirely sure about non-Flambda ocamlopt
<discocaml> <dinosaure> OCaml too if the integer does not go out of the scope of the function 🙂
<discocaml> <dinosaure> you must check but I just figured out yesterday that OCaml became smarter about that now
<discocaml> <otini_> ah good to know. That works for any allocated value? If it doesn’t escape, it can be optimized away?
<discocaml> <dinosaure> yes, I just did this code yesterday and see what OCaml produce: https://godbolt.org/z/ebvzo4WYW
<discocaml> <dinosaure> you can see that the `caml_call_gc` is only about the `assert false` branch
<discocaml> <dinosaure> otherwise, OCaml is really able to use registers even for an `int64`
gdiazlo_caml has joined #ocaml
<discocaml> <otini_> neat
<discocaml> <dinosaure> (and note that I benchmark `bigstring` and `bytes` and my result is mitigated :D)
<discocaml> <dinosaure> (like, perf on `bigstring` can be easily predicted but `bytes` can outperform in some situations...)
<adrien> I'm on non-flambda and not very eager to change that while I'm doing other things too
<adrien> I'll try to multi-thread that code and I'll see how that goes but later today at the earliest
<discocaml> <otini_> np
<discocaml> <otini_> just to be sure we are on the same page, multithreading will not give you more performance
<discocaml> <otini_> except on the C primitives possibly
<adrien> it's been a long time I thought about MT on ocaml but I'm doing a lot of work on bigarrays
<discocaml> <otini_> mm
<discocaml> <otini_> benchmarking is hell
<adrien> I think nothing else is likely to allocate
<adrien> 0.005% done after 4 minutes...
<discocaml> <otini_> yeah but ocaml code will not run in parallel in ocaml 4
<adrien> hmpf, I thought bigarrays could give some of that
<adrien> guess the code will be ready for ocaml 5 then!
<discocaml> <otini_> only your bigarray primitives, and I’m pretty sure they don’t release the runtime lock either
<adrien> murmur3 is also C code so maybe that will help
<discocaml> <otini_> so not even those
<discocaml> <otini_> well, ocaml should be backward-compatible 😎
<discocaml> <otini_> > <adrien> murmur3 is also C code so maybe that will help
<discocaml> <otini_> depends whether the C wrappers release the runtime lock
<adrien> let me hope! :D
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
euphores has quit [Ping timeout: 252 seconds]
euphores has joined #ocaml
torretto has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
torretto has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
sroso has quit [Quit: Leaving :)]
gdiazlo_caml has quit [Ping timeout: 260 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 252 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 248 seconds]
gdiazlo_caml has joined #ocaml
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 246 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 252 seconds]
gdiazlo_caml has joined #ocaml
bhoot has joined #ocaml
waleee has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
tomku has quit [Ping timeout: 276 seconds]
tomku has joined #ocaml
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 272 seconds]
dh` has quit [Changing host]
dh` has joined #ocaml
bhoot has quit [Ping timeout: 255 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 248 seconds]
gdiazlo_caml has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
pi3ce has quit [Client Quit]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
Tuplanolla has joined #ocaml
alexherbo2 has joined #ocaml
euphores has quit [Quit: Leaving.]
alexherbo2 has quit [Remote host closed the connection]
bhoot has joined #ocaml
bhoot has quit [Remote host closed the connection]
bhoot has joined #ocaml
euphores has joined #ocaml
mjs22 has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 246 seconds]
bhoot has quit []
mjs22 has quit [Ping timeout: 252 seconds]
mjs22 has joined #ocaml
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 255 seconds]
mjs22 has quit [Quit: Konversation terminated!]
mbuf has quit [Quit: Leaving]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 260 seconds]
waleee has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 252 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Remote host closed the connection]
gdiazlo_caml has joined #ocaml
bartholin has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
bartholin has quit [Quit: Leaving]
gdiazlo_caml has quit [Ping timeout: 260 seconds]
gdiazlo_caml has joined #ocaml
mjs22 has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 246 seconds]
Serpent7776 has quit [Ping timeout: 276 seconds]
waleee has joined #ocaml
gdiazlo_caml has joined #ocaml
alexherbo2 has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
alexherbo2 has quit [Ping timeout: 256 seconds]
gdiazlo_caml has quit [Ping timeout: 260 seconds]
gdiazlo_caml has joined #ocaml
gdiazlo_caml has quit [Ping timeout: 244 seconds]
gdiazlo_caml has joined #ocaml