<havenwood>
uu6crain: Either should give you a clear idea of behavior on close study.
harai has quit [Ping timeout: 260 seconds]
harai has joined #ruby
<uu6crain>
That is to say, core classes like String aren' written in ruby? I have compiled ruby on linux before and I saw 'miniruby' on the console output. I just want to have a try on reducing memory consumption on string.
greengriminal has quit [Quit: This computer has gone to sleep]
<havenwood>
uu6crain: In CRuby, core classes are written in C and stdlib is largely written in Ruby. Show an example of memory usage that you'd like to reduce? Looking at the C reference implementation in particular?
<uu6crain>
Just a thought of a moment. Don' take it too serious.
thejs has quit [Quit: Leaving]
ravenousmoose has joined #ruby
ravenousmoose has quit [Ping timeout: 246 seconds]
_phaul has joined #ruby
phaul has quit [Ping timeout: 246 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bitwinery has quit [Quit: Leaving]
skx86 has quit [Quit: Connection closed for inactivity]
conta has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
aesthe has quit [Quit: Leaving]
conta has quit [Quit: conta]
sauvin has joined #ruby
conta has joined #ruby
jenrzzz has joined #ruby
ravenousmoose has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Intelo has quit [Ping timeout: 268 seconds]
Intelo has joined #ruby
dellavg has joined #ruby
chalkmonster has joined #ruby
jordanm has quit [Ping timeout: 265 seconds]
suukim has joined #ruby
sandstrom has joined #ruby
jordanm has joined #ruby
uu6crain has quit [Remote host closed the connection]
crella133 has joined #ruby
dionysus70 has joined #ruby
teclator has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
dionysus70 is now known as dionysus69
cthu| has joined #ruby
lineus has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
andikr has joined #ruby
<crella133>
I used ruby to write a script to write the names of files and directories in a path. Then I printed all strings in the array of files to a txt file, the same work with the array of directories to another txt file, both in utf-8 encoding. There should be 714246 strings in the two arrays. The result txt files add up to 709600 lines and take up 110.7MB space on HDD. On ruby 2.6.5 win-x64, it consumed 443MB memory (taskmgr, workset).
dionysus69 has quit [Ping timeout: 265 seconds]
schne1der has joined #ruby
dionysus69 has joined #ruby
ur5us_ has quit [Remote host closed the connection]
ur5us has joined #ruby
<MentalPower>
crella133: is there a question in there?
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
<crella133>
Err, I checked a string's memory size in another way, and I think that a simplest string would take up as much size in memory as it would take up as a utf-8 text file on HDD.
ur5us has quit [Ping timeout: 265 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crella133>
I did it by pushing a simple string to an array 1000..00 times and checked the memory increasement of the ruby process on gnome-system-monitor on freebsd. And in that condition , the string 'hi i am a string' approximately takes up 6KB memory.
<crella133>
Typed wrong. The string 'hi i am a string' approximately takes up 6Byte memory.
<crella133>
I need to study more. Sorry for interruption.
crella133 has quit [Quit: crella133]
Intelo has quit [Ping timeout: 240 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schne1der has quit [Ping timeout: 240 seconds]
Intelo has joined #ruby
akemhp has quit [Quit: Leaving]
JohanP has quit [Remote host closed the connection]
infinityfye has joined #ruby
Guest4676 has quit [Quit: All for nothing]
jenrzzz has joined #ruby
olspookishmagus has joined #ruby
Intelo has quit [Ping timeout: 265 seconds]
crella133 has joined #ruby
crella133 has quit [Client Quit]
kyrylo has joined #ruby
cd has quit [Quit: cd]
Intelo has joined #ruby
DaniG2k has joined #ruby
Fernando-Basso has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
DaniG2k has quit [Quit: leaving]
paraxial has joined #ruby
fig-le-deunch has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
<leftylink>
I'm trying to recall a situation where I think someone checked whether GC had ran by seeing whether a certain object still existed. but I'm not sure how that could work. if the code knew to check for the existence of the object, wouldn't that prevent said object from being GC'd? It is a mystery
<leftylink>
but maybe that will inspire someone to fill in the blanks on how this sort of solution could possibly work
<leftylink>
wishing luck!
jenrzzz has quit [Ping timeout: 245 seconds]
<phaul>
I have no idea but from some stuff I watched in the past the notion of "weak references" pop to my mind
<phaul>
maybe wasn't even ruby :D nvm
ElFerna has quit [Ping timeout: 276 seconds]
<phaul>
do we have a tracepoint event for GC finishing?
jenrzzz has joined #ruby
drincruz has joined #ruby
<phaul>
apperantly not
tpanarch1st_ has joined #ruby
SuperLag has quit [Remote host closed the connection]
<fredolinhares>
First I must start the engine before I can use some classes, then I must destroy any instances of those classes before ending the engine.
Intelo has quit [Ping timeout: 240 seconds]
Intelo has joined #ruby
akemhp has joined #ruby
sandstrom has joined #ruby
krawchyk has joined #ruby
brool has joined #ruby
bsdbandit-01 has joined #ruby
bsdband18 has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
oncall-pokemon has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
xco has joined #ruby
poontangmessiah_ has joined #ruby
poontangmessiah has quit [Ping timeout: 240 seconds]
bsdband82 has joined #ruby
bsdbandit-01 has quit [Ping timeout: 250 seconds]
jinie_ has joined #ruby
jinie has quit [Ping timeout: 268 seconds]
jinie_ is now known as jinie
schne1der has quit [Ping timeout: 250 seconds]
cloaked1 has joined #ruby
<Net>
I want to generate a performant hash constructor based on some data. It's a potentially nested hash so it's not as simple as just mapping over the fields. Does it make sense to generate ruby code to construct the hash and eval it (the data is trusted)?
davidw has quit [Ping timeout: 265 seconds]
sammi`_ has joined #ruby
<Net>
the source data looks something like {user: {name: [:string, :where_to_find_the_name], started_at: [:datetime, :where_to_find_the_datetime]}, ...}, etc.
bitwinery has quit [Quit: Leaving]
bitwinery has joined #ruby
AJA4350 has joined #ruby
sammi` has quit [Ping timeout: 240 seconds]
Intelo has quit [Ping timeout: 250 seconds]
AJA4351 has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
orbyt_ has joined #ruby
Intelo has joined #ruby
gray_-_wolf has quit [Quit: WeeChat 2.6]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
rbruchal has quit [Ping timeout: 245 seconds]
krawchyk has quit [Quit: krawchyk]
sarink has quit [Remote host closed the connection]
cloaked1_ has quit [Remote host closed the connection]
cloaked1_ has joined #ruby
davidw has joined #ruby
cloaked1_ has quit [Remote host closed the connection]
cthulchu has joined #ruby
cloaked1_ has joined #ruby
cloaked1_ has quit [Changing host]
cloaked1_ has joined #ruby
cthu| has quit [Ping timeout: 250 seconds]
AJA4351 has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
cloaked1_ has quit [Client Quit]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
sarink has joined #ruby
cloaked1_ has joined #ruby
Fridtjof has quit [Ping timeout: 265 seconds]
chalkmonster has quit [Quit: WeeChat 2.6]
cloaked1_ has quit [Client Quit]
AJA4351 has joined #ruby
davidw has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
skx86 has quit [Quit: Connection closed for inactivity]
<havenwood>
Net: My first thought is to use ERB or sprintf to create JSON or YAML, which you can deserialize.
<havenwood>
Net: Can you show the data and desired hash, or an equivalent example?
chalkmonster has joined #ruby
yoshie902a has quit [Quit: yoshie902a]
bsdbandit-01 has joined #ruby
bsdband82 has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
<Net>
havenwood: the reason for the input data is so that data can be preloaded based on the sources specified in the input data
<Net>
I'd like to locate the output structure and the required data together as it has gotten rather long and I thinks this is the best way to prevent mistakes
yoshie902a has joined #ruby
yoshie902a has left #ruby [#ruby]
Fernando-Basso has quit [Quit: Leaving]
<Net>
so really the input would look more like {author: {name: [:users, :name], started_at: [:users, :created_at}} and then the code would know that it needs to load the name and created_at attributes for the list of users (this is a batch export)