#Better safe than sorry save yourself an

1 messages · Page 1 of 1 (latest)

inland egret
#

thats not right

unkempt basin
#

you wont be so optimistic if your bot grows large enough and have to cache 100k+ member or else

inland egret
#

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

unkempt basin
#

large bot tryin' to limit cache and avoid saving thing and you are doing the exact opposite

inland egret
#

havent had it fail in 2 years

#

No missed members

valid robin
inland egret
#

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

patent juniper
#

Why?
do you not trust discord.js?

inland egret
#

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

patent juniper
#

can't believe such an argument about this thing can exist

inland egret
#

Pls let us just discuss this

inland egret
#

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

unkempt basin
#

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

inland egret
#

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 Bird_love

#

Yea, looking into process.

#

EW

#

hol up

valid robin
#

bro butchered that completely

inland egret
#

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

valid robin
#
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

inland egret
#

its quite interesting seeing the stats, im just not yet sure on what they mean

valid robin
#

yw

inland egret
#

thanks xd