Re:What's up, Python? The GIL removed, a new compiler, optpa...
by Jtsummers on Sunday July 30, 2023 @08:00PM
(#36937366)
> I'd just use asyncio to serve up read requests to the data and it should scale quite well.
Quoting GP:
>> often CPU heavy
We have to take their word for it that it's actually CPU heavy work, but if they're not lying and not mistaken then asyncio would do nothing for them.
Re:What's up, Python? The GIL removed, a new compiler, optpa...
by tsimionescu on Monday July 31, 2023 @01:30AM
(#36939114)
Reading from memory is really not IO. Perhaps you're suggesting doing something like mmapping a file to memory, putting the data structure in that memory, and then using asyncio on the file to serve things, but this would only work if you can compute byte ranges inside the file to serve ahead of time, in which case there are much simpler solutions anyway. Most likely, when receiving a query they need to actually search through the datastructure based on the query, and it's very likely that this is the bottleneck, not just reading some memory.
If you're allowing writes to the shared data structure... I'd ask myself am I using the right tool for the job. A proper database server like postgres will handle concurrent writers much, much better than you could code up hastily. And it will handle failures, backups, storage, security, configuration, etc. far better than an ad hoc solution.