<RX14>
thats pretty much the least performant way to write a file
<FromGitter>
<sdogruyol> what do you suggest?
<RX14>
IO.copy
<FromGitter>
<sdogruyol> ugh
<FromGitter>
<sdogruyol> and how would i use that?
<RX14>
File.open(filename) do |file|
<RX14>
IO.copy(data, file
<RX14>
end
<FromGitter>
<sdogruyol> oh i see
<RX14>
well
<FromGitter>
<sdogruyol> makes sense
<RX14>
File.open(file, "w")
<FromGitter>
<sdogruyol> yeah definitely faster
<FromGitter>
<sdogruyol> takes half of the time 400ms to 200 ms
<FromGitter>
<johnjansen> @RX14 thats an awesome tip, it just doubled my download speed for another project … these tips need to be organized somewhere
<RX14>
yeah, they are, it's called the docs :P
<FromGitter>
<sdogruyol> @johnjansen agreed
<FromGitter>
<sdogruyol> well File.write is like pretty common so you dont bother anything else unless it's really slow
<RX14>
it seems pretty obviousl that converting a file to a string and writing it out again will be slow
<RX14>
think of all that memory allocation
<FromGitter>
<sdogruyol> yeah makes sense
Ven_ has quit [Read error: Connection reset by peer]
<RX14>
IO.copy read 8kb into the stack, and writes it out again in a loop
<RX14>
oh, no
<RX14>
1kb
Ven_ has joined #crystal-lang
<FromGitter>
<johnjansen> totally … however, programming is like assembling a jigsaw with 9000 pieces and no reference picture, sometimes it helps to get a nudge in the right direction
<FromGitter>
<sonic182> Hi
<RX14>
hi
<FromGitter>
<johnjansen> hi
Ven_ has quit [Client Quit]
<FromGitter>
<sonic182> Oh I tried to add a break line and it sends the message
<FromGitter>
<sonic182> There is no way to insert break lines on this chat? Anyway... I rewrote a genetic algorithm from ruby (jruby) to crystal and I have to say it's very fast right known
<RX14>
nice
<FromGitter>
<sdogruyol> @sonic182 genetic algorithm? That sounds badass
<FromGitter>
<sonic182> https://github.com/sonic182/ia_proy2_ruby (on branch crystal run) but it's academic stuff, when I was on college, the code is in Spanish, comments, :/
<FromGitter>
<johnjansen> That is an excellent use of crystal and in fact one area where the language can really make an impact
<FromGitter>
<sonic182> And it doesn't follow best practices hehehe
<FromGitter>
<sdogruyol> cool
<FromGitter>
<sdogruyol> how about publishing some benchmarks?
<FromGitter>
<sdogruyol> that'd be great
<FromGitter>
<johnjansen> i was just about to say ...
<FromGitter>
<sonic182> But yes, I'm thinking to use crystal with micro services for AI stuffs ⏎ Stuffs
<FromGitter>
<johnjansen> talk to @sdogruyol about Kemal
<FromGitter>
<sdogruyol> yeah i can help with that i guess lol
<FromGitter>
<sonic182> Maybe for an Argentina guy can understand what was the project for with the documents that I have (my repo). I'm going to organize that code and translate it to English. Whenever I got time for that xD
<FromGitter>
<sonic182> How long will it takes to crystal be stable? Just asking 🙈
<RX14>
a think a while yet
<FromGitter>
<jwoertink> It's good enough for government work
<FromGitter>
<sdogruyol> roflmao
<FromGitter>
<sdogruyol> @sonic182 it depends. For me it's been pretty stable since the beginning of this year
<FromGitter>
<sdogruyol> no big breaking changes e.g
<BlaXpirit>
faustinoaq, uhh seems like the logo is under no license, so technically probably can't use it
pawnbox has joined #crystal-lang
<FromGitter>
<faustinoaq> Ok, but How other programming languages have a logo in the wikipedia article? Should Manas create an Licence for the Logo?
<FromGitter>
<sdogruyol> @faustinoaq i've seen people before asking for logo usage
<FromGitter>
<sdogruyol> and @asterite was ok with it
<BlaXpirit>
that's not how people on wikipedia roll
pawnbox has quit [Remote host closed the connection]
<BlaXpirit>
faustinoaq, yes, the logo should have a license first
<BlaXpirit>
i'm sure nobody minds adding a license but it just wasn't done
pawnbox has joined #crystal-lang
A124 has quit [Read error: No route to host]
<FromGitter>
<faustinoaq> <BlaXpirit> @sdogruyol Ok, I think that I should wait for Manas or @asterite opinions. The Wikimedia guys takes the licences seriously :worried: