#Better safe than sorry save yourself an
1 messages · Page 1 of 1 (latest)
you wont be so optimistic if your bot grows large enough and have to cache 100k+ member or else
it wont
so thats fine
and
1x pulling all members
is 1 request
and not fetching every time i need a member in my code and hoping its accidentally in there
Yea lets make a tonne of requests instead of 1
whats less intensive lol
large bot tryin' to limit cache and avoid saving thing and you are doing the exact opposite

Then please stand by your point
Just saying theres no hit to doing it this way
or else i wouldve known :/
You literally say better many requests than 1x getting all of the members
sorry
you arent making sense
Ye
so i make sure they are all there
to not have to worry about them ever not bein gthere
Why?
do you not trust discord.js?
Oh pls dont
Not consistently like you say
so i make sure it is consisten
1 api request
and done
your way would have me make many requests during the running of the bot
growing my cache anyways
who cares about 1x a lot of data
its all data i want to have anyways?
code is fine
40 mb ram
it would anyways if i fetch
cus fetch takes from cache
then requests if it doesnt find
so what
1x all cache
or many times smaller
idc about startup time being 0.5s slower
if that
I have instant responses to all my code
so theres no issue
no wolf
can't believe such an argument about this thing can exist
Pls let us just discuss this
Then leave and dont read it
wouldnt the cache grow during the running
and like you say it is already filled partially at boot
so the performance cant be that big of a dif
you really want to avoid making api calls, no?
even though we say 'dont do api spam' this and that, discord api infrastructure isnt that small
yea, so thats why i adopted making 1 call
cus i thought, if im doing a req, might as well go all in
id be interested to test and see how big the difference in performance is
im working to get the stats from my machine and see how much ram and stuff it pulls
they are already instant
so more instant wouldnt make a dif
i cant tell the different
so for the user experience
it wont matter
you need members to be fetched to get username updated events?
i think i initially did it for that
but
thats beside our current discussion lol
wasnt meant to be rude to you
am interested in the gains and losses of it
okay good, didnt mean to be 
Yea, looking into process.
EW
hol up
bro butchered that completely
Thanks yea
//const formatMemoryUsage = (data) => `${Math.round(data / 1024 / 1024 * 100) / 100} MB`
//const memoryData = process.memoryUsage()
//const memoryUsage = {
// rss: `${formatMemoryUsage(memoryData.rss)} -> Resident Set Size - total memory allocated for the process execution`,
// heapTotal: `${formatMemoryUsage(memoryData.heapTotal)} -> total size of the allocated heap`,
// heapUsed: `${formatMemoryUsage(memoryData.heapUsed)} -> actual memory used during the execution`,
// external: `${formatMemoryUsage(memoryData.external)} -> V8 external memory`,
//}
//console.log(memoryUsage)```
Wtf
i am doing ```js
well we will have to deal with it
const formatMemoryUsage = (data) => `${Math.round(data / 1024 / 1024 * 100) / 100} MB`
const memoryData = process.memoryUsage()
const memoryUsage = {
rss: `${formatMemoryUsage(memoryData.rss)} -> Resident Set Size - total memory allocated for the process execution`,
heapTotal: `${formatMemoryUsage(memoryData.heapTotal)} -> total size of the allocated heap`,
heapUsed: `${formatMemoryUsage(memoryData.heapUsed)} -> actual memory used during the execution`,
external: `${formatMemoryUsage(memoryData.external)} -> V8 external memory`,
}
console.log(memoryUsage)
there
its quite interesting seeing the stats, im just not yet sure on what they mean
yw
thanks xd