|
if a bunch of neckbeards in yospos can't read that parellisation code, you can't understand it, and your poo poo is fast anyway, then just keep it simple. don't implement it. maintainable code is more important than efficient or fast code
|
# ? Jun 3, 2021 05:43 |
|
|
# ? Apr 28, 2024 03:29 |
|
Storysmith posted:okay so the code assumes you have a 1-dimensional list that has all the pixel values of your av image. actually from what i can tell in the docs, it forks 32,400 new python interpreter processes and sends the alpha value of one pixel and the is_transparent function to each process. each process calls is_transparent on the value of the one pixel it was assigned, and passes the result back to the main process. the main process collects all the results and puts them into a sequence called x, and all() tells you if all of them are transparent, or at least one isn’t transparent so basically what you said but it’s forking a new process for each pixel to maximize parallelization
|
# ? Jun 3, 2021 06:00 |
|
As noted earlier a single threaded version checks the whole avatar in 7 milliseconds so you could have people doing this 12 million times a day on average before you even start to overlap requests, let alone produce noticeable lag.
|
# ? Jun 3, 2021 06:00 |
|
Sagebrush posted:As noted earlier a single threaded version checks the whole avatar in 7 milliseconds so you could have people doing this 12 million times a day on average before you even start to overlap requests, let alone produce noticeable lag. that 7 milliseconds also included constructing the list of values and printing to console too!
|
# ? Jun 3, 2021 06:02 |
|
hbag posted:i dont think checking the transparency of a pixel at most 32,400 times is very efficient computers are very, very, very fast like if you use an image processing library something like this should be fully vectorized and just fly what do you want to use this for anyway
|
# ? Jun 3, 2021 06:07 |
|
fart simpson posted:pro tip: if you use a statically typed compiled language you’ll encounter this more often imo it’ll just be so much pain to write in the first place that you’ll decide to do something else op use Lisp not Haskell
|
# ? Jun 3, 2021 06:09 |
|
rotor posted:hbag, are you familiar with nntp I love you too
|
# ? Jun 3, 2021 06:11 |
|
see you in September starts playing in the background
|
# ? Jun 3, 2021 06:12 |
|
hbag you should build the forums authenticator and then use it to write an NNTP gateway for the forums on top of papercut
|
# ? Jun 3, 2021 06:13 |
|
hbag posted:i thought putting loops inside loops was a bad idea real software is nothing but loops in loops all the way down
|
# ? Jun 3, 2021 06:15 |
|
eschaton posted:it’ll just be so much pain to write in the first place that you’ll decide to do something else use both imo
|
# ? Jun 3, 2021 06:20 |
|
feeling extremely torn between romanticizing NNTP and the rest of the Old Net as a meeting of the minds unsullied by corporate advertising and venture capital, and the awareness that there was a process for figuring out who those minds got to be and it was mostly people like me and that one of the few benefits of this social media hellscape we live in is the sheer diversity of human experience on display in conclusion endless september is a land of contrasts
|
# ? Jun 3, 2021 06:21 |
|
fart simpson posted:actually from what i can tell in the docs, it forks 32,400 new python interpreter processes and sends the alpha value of one pixel and the is_transparent function to each process. each process calls is_transparent on the value of the one pixel it was assigned, and passes the result back to the main process. the main process collects all the results and puts them into a sequence called x, and all() tells you if all of them are transparent, or at least one isn’t transparent this is insane it takes a single cycle to check if a 32-bit RGBA value is fully opaque or not. it takes several hundred cycles to context switch between one process and another. fully forking processes is also absurdly slow what the gently caress is wrong with p-lang people
|
# ? Jun 3, 2021 07:56 |
|
Kazinsal posted:this is insane i feel like things might have gone over your head somewhat
|
# ? Jun 3, 2021 08:50 |
|
Gentle Autist posted:you say this every time you post, lol that makes sense, im always exhausted
|
# ? Jun 3, 2021 09:14 |
|
Jonny 290 posted:this poo poo is why i gave up trying to learn Coding. what the gently caress is this jonny this post makes me feel validated. bless you.
|
# ? Jun 3, 2021 13:28 |
|
Jonny 290 posted:this poo poo is why i gave up trying to learn Coding. what the gently caress is this you just describe a computation that you want to apply to a bunch of things and let the computer split up the work across a bunch of threads I mean that code looks like crap but it's because
|
# ? Jun 3, 2021 13:39 |
|
for me the concept is easy enough. it’s the loving syntax that frustrates me.
|
# ? Jun 3, 2021 13:59 |
|
it probably doesn’t help that I didn’t start touching computers for a living until i was 40 (last year lol)
|
# ? Jun 3, 2021 14:02 |
|
Gentle Autist posted:if a bunch of neckbeards in yospos can't read that parellisation code, you can't understand it, and your poo poo is fast anyway, then just keep it simple. don't implement it. maintainable code is more important than efficient or fast code worker_pool.map(function, collection) which requires the person to be familiar with map Khorne fucked around with this message at 14:36 on Jun 3, 2021 |
# ? Jun 3, 2021 14:18 |
|
it's important to also note that it is such a nonsense application of parallelization as to inherently not make sense
|
# ? Jun 3, 2021 14:51 |
|
Bloody posted:it's important to also note that it is such a nonsense application of parallelization as to inherently not make sense mlyp
|
# ? Jun 3, 2021 14:52 |
|
Guido: now who's sorry, now who's the loving rear end in a top hat?
|
# ? Jun 3, 2021 15:10 |
|
amazing that the fake venezuelan president is also the guy who unleashed python on the world. what a piece of work
|
# ? Jun 3, 2021 15:32 |
|
Gentle Autist posted:if a bunch of neckbeards in yospos can't read that parellisation code, you can't understand it, and your poo poo is fast anyway, then just keep it simple. don't implement it. maintainable code is more important than efficient or fast code
|
# ? Jun 3, 2021 16:43 |
|
just loving loop it lmao
|
# ? Jun 3, 2021 17:21 |
|
really i think the next split for the hbag speedrun of being a computer nerd in 2003, the one right after making a forums sig image service, is getting addicted to wow and doing nothing else for 5 years. e: apparently the new 100% category bypasses the mirc scripts. Cybernetic Vermin fucked around with this message at 18:03 on Jun 3, 2021 |
# ? Jun 3, 2021 18:01 |
|
multiprocessing is really bootleg but it also whips rear end when you need it, love that library logging from it is weird though and requires actually understanding what's going on under the hood https://docs.python.org/dev/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes
|
# ? Jun 3, 2021 18:04 |
|
eh i got it working check it out
|
# ? Jun 3, 2021 18:10 |
|
hbag posted:eh i got it working nice
|
# ? Jun 3, 2021 19:50 |
|
rookie numbers e: make it animate
|
# ? Jun 3, 2021 19:57 |
|
Fuzzy Mammal posted:
blegh later
|
# ? Jun 3, 2021 20:04 |
|
fyi if you're trying for sophisticated effects you may want to look at svg. Its a lot more flexible for this kind of thing than just rasters and you can always render it to a png at the end if you want to
|
# ? Jun 3, 2021 20:08 |
|
you should render the probation frame around the avatar that'd be cool
|
# ? Jun 3, 2021 20:09 |
|
rotor posted:fyi if you're trying for sophisticated effects you may want to look at svg. Its a lot more flexible for this kind of thing than just rasters and you can always render it to a png at the end if you want to honestly i barely even know what an svg is
|
# ? Jun 3, 2021 20:09 |
|
Archduke Frantz Fanon posted:
eventually, once ive got all this poo poo running how i want
|
# ? Jun 3, 2021 20:09 |
|
transparency masking for gifs is being fucky for example:
|
# ? Jun 3, 2021 20:13 |
|
rotor posted:fyi if you're trying for sophisticated effects you may want to look at svg. Its a lot more flexible for this kind of thing than just rasters and you can always render it to a png at the end if you want to didn't know you could include images into svgs, i'll have to keep that in mind next time i gently caress around with them
|
# ? Jun 3, 2021 20:50 |
|
hbag posted:honestly i barely even know what an svg is its a vector graphics file format. The nice thing is its css-sensitive and has effects like blur and zoom and animations and so forth that you can author in a text file instead of pixel-by-pixel
|
# ? Jun 3, 2021 21:52 |
|
|
# ? Apr 28, 2024 03:29 |
|
Eeyo posted:didn't know you could include images into svgs, i'll have to keep that in mind next time i gently caress around with them svg is in fact very good
|
# ? Jun 3, 2021 21:53 |