Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

Rather, don't use threading for the sake of parallelism in Python.

Threads in Python are mostly useful to avoid blocking:

- you need to make io calls and don't want to bring asyncio

- you need to process things in the background without blocking the main thread (e.g: zippping things while you use a GUI)

- you want to run a long process on a c-extension based data structure (they release the gil, so you get the perf boots), such as a numpy array or a pandas DF


Yes, a first version has been released, but it still needs a lot of ironing.


Awesome! Would it be ready for the next version?


Unlikely. The module is usable, and you can already import it and run it. But the perf benefit are still not there.


What is this module about actually? I mean, is it a model to run code in parallel in some way different to multiprocessing?


For now it's only at the c level, with a python api in discussion: https://www.python.org/dev/peps/pep-0554/

The idea is that the python code interpreter would not rely on global variables anymore, so that you can instantiate it several times.

The GIL is tied to the interpreter, meaning 2 threads in 2 different interpreters do not share a gil, and can be schedule on different CPU.


This is for real, but this doesn't mean you can't use parallelism. Only that you can't use thread for them most of the time .

Parallelism strategies in Python usually revolve around using the multprocessing module, a c extension (numpy will release the gil, and hence all the science stack) or using a 3rd party tools (dask is pretty popular, and allow easy parallelism: https://dask.org/).


Even python's parallelism is subpar because objects passed across processes have to be pickled. This both takes time and limits the kinds of objects that can be sent across processes (no lambdas, for instance).


> For instance, a local cache of some values is basically useless when python is used as backend. Since there will be multiple processes handling the requests (in the same node), they don't share memory.

If you want to share low level memory between process, use SharedMemory: https://docs.python.org/3/library/multiprocessing.shared_mem...

If you want to share high level data structure between process, use diskcache: http://www.grantjenks.com/docs/diskcache/tutorial.html

This is, granted, not as straightforward as just sharing a variable between threads, but it will get you far.


That's like claiming the ability to share JS ArrayBuffer's between workers supplants the need for the ability to share high level objects like a Map.

What I'm getting at is that JS had the exact same problem, and it offers the same ability for sharing blocks of raw memory. But the same pitfalls for any actual structured object.

Instead, we have to serialize/unserialize (creating a copy) from a separate worker, process, or disk source, it's performance is shite for objects of large size.

Message passing is not ideal for large pieces of data. Shared memory is hundreds of times faster.


Yes. SharedMemory can share list (https://docs.python.org/3/library/multiprocessing.shared_mem...) but that's it.

That's why diskscache is better as an alternative for complex objects: https://pypi.org/project/diskcache/

It's not as good as a simple shared variable, but it's surprisingly performant, since it uses memory-mapped files.


I see what you mean. Does diskcache still have to do deserialization of the mapped data? Nested objects (large disparate heap pointer graphs) would suffer performance penalties.


It does yes, although pickle is pretty fast, it's still a penalty.


I'm using audible, and I use a software to backup all books I paid for in a non DRM format. A spotify reaper would make tons of sense.


We have been down this road before in 2000, so we know it leads to the total opposite of "make development simpler".

When IE6 became the engine mono culture, it was the best.

But then it stopped innovating, because it didn't need to. It also pushed moves that were only for the good of Micorosoft, since they had monopoly, trying to make the web a less open place.

It was a pain to develop for, a pain to debug, and a capricious master.

Google has shown they can be very naughty as soon as they got power over something.

Learn from history. Do not give them that power.


My guess is PR.

Regularly, on imgur, you see a pic in interest for a celebrity, a rich person, a movie. It looks organic, but if you look closely, there are plenty of weird things about it. Then it disappears as suddenly as it arrived.

I believe that they sell the front page to PR firms that need to promote something in a way the people think themself came up with the hype.

It's probably the same for a lot of communities with a strong influence on trends, like popular sub reddits or hacker news.

There is no better ads than the one you don't see. There is no better slogan than the one you repeat to your friends as a catchphrase. And there is no better propaganda than the one based on ideas you thought you had by yourself.


Yeah but who goes to the front page of imgur?


I one time posted an album on Imgur of my hobby project. I was hoping it would do well on the niche subreddit it involved.

It did ok on reddit (100 upvotes) but a few thousands upvotes on Imgur and made the front page with hundreds of thousands of views. I was shocked since I didn't even know that was a thing. But my guess is popular with people who are on their phone a lot, are not as tech saavy, or international.


The exact opposite personality type to people that browse HN I'd wager


I, and apparently Swizec (https://news.ycombinator.com/item?id=28676558), do both, and I doubt we're the only ones.


Yes, there might be dozens of you.


For the uninitiated, this is a meme reference to a clip from the TV show Arrested Development, popular on Imgur as a reaction to show support for someone else who expresses a sense of loneliness in their appreciation or affection.

A version of this: https://i.imgur.com/pgXjbNy.gifv


How much could a banana cost? 10 dollars?


No there's plenty, HN just has the kind of people who need to loudly proclaim they don't engage with <insert popular thing>

That wrongly creates the impression that there are only a few HN users engaging with it.


HN and Imgur are among my favorite sites on the web!

Both sites are quite "nerdy". Each in their own way.


I used to in college. Extremely bad habit, was easy to spend 4+ hours there just hitting the right arrow.


Same. I stopped when I realised it was passively teaching me celebrity gossip, which I never wanted to know.


It's so easy to absorb 'celebrity' gossip, I always wondered if it'd be possible to do the same with say science or maths, if it was presented in the same kind of format.


I think the hardest part is the rigour. Math and science build on concepts over time, and mastery is easier with more hands-on experience. Just presenting it to someone in a feed might be waaay too passive for absorption.


Easy way to find out. Remove the pictures from celebrity gossip posts, and see how much you remember.


Somehow I’d always end up doing this most right in the middle of finals.


You can actually spend days doing that…


I recall being in high school (around 2013, 2014) and some of my classmates would browse imgur while slacking off from work. Not sure how big it is these days, but I think some people use it the same way you'd browse r/funny on reddit, or iFunny. Except there isn't really a topic, it's just images of whatever people think is interesting.


Who doesn't? It's the best source of almost everything. Perfect mix of culturally important twitter and news screenshots and entertaining gifs.


I scrolled through it for five minutes just now. Advice animals, rage-bait about politicians, political cartoons, cute animals—this is complete garbage.


Absolutely this. imgur.com is the only reason I can pretend to be "down with the kids".


Oh yes also all the good/important tiktoks end up on there. I don’t even have tiktok and am conversant in all the memes.

7/7 would recommend


If you were really an imgurian, you'd know that the correct perfect score is 5/7.


Huh wow, you weren't kidding!

I remember going on the front page of Imgur once a couple of years back and it seemed less entertaining and more rage-baity than now -- think I'll revisit that decision...


Some of the comments are sometimes quite interesting. Sometimes they're even brilliantly witty.


The way some of the replies talk about the front page of imgur (huge time sink, insightful, entertaining, keeps you in the loop) is the same way I'd talk about the FYP on tiktok.


Plenty of people, overwhelmingly men[1].

Make no mistake, Imgur is a social network. It has its own memes, regular posting themes, and users recognised by the community[2].

[1]: They are (were?) proud of that and bragged about it in a page describing themselves.

[2]: https://knowyourmeme.com/memes/anewbadlyphotoshoppedphotoofm...


People that subscribe to default subreddits and click the Youtube "Featured" section.


I only now learned that it has such a thing and decided to see it, and I am very confused by the lack of advertisement on it indeed.


People who want to find memes to repost on their social media.


My retired father?


you're forced there if you want to upload something


But who are these companies that successfully provide this service?


It's just an educated guess, so I don't know.

Besides, such company would do its best to stay discrete, by design.


I'm aware of one such company that uses Imgur like that and that deals with celebs. Imgur isn't their primary target, it's just a handy layer of abstraction away from the real target so the content can't TRULY be taken down on the target site. Plus, it shows you how many impressions you get for free. That way they can gather up their campaign image urls and views at the end of the contract and show hard results without the need for a fancy, paid analytics dashboard or campaign tracking system.


I assume money laundering


How would you know which miner would pick up this transaction and process it?


You privately send it to the colluding miner; you don't publicly broadcast it.


That would be visible to those that save the full protocol state / interactions but probably invisible to almost anyone else.

And you could even broadcast it after you know the miner already solved a valid block with it but before they publish it.


You don't have to propagate the transaction to other miners.


Maybe do not publish the tx and be the only one including it in potential blocks until successful.


I don't know, but it's an unlikely mistake to make, and they have a lot of know how in the business. I expect them to know something we don't about the protocol, and setup things in a way that they get the money with plausible deniability.


If it were money laundering, they would have not broadcast the transaction.

In this case, the transaction was broadcast to the mempool before it was mined.


How is anything "laundered" in that scenario as opposed to simple sending the money as the transaction content?


It's not. This is like not subtle at all, there's a lot of real time monitoring on fees to decide the optimal one for your transactions. If this was not a mistake and it's really someone trying to hide the 23m transaction, they just didn't know what they were doing. A normal transfer would have been sneakier.


It feels like when somebody opens a ( but doesn't close it.


)


There is such a big latency in HN for self closing parenthesis.


Yes, but only if it falls back to text diff as soon as there is the smallest doubt it can't provide a good AST diff.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: