Why do whatsapp web application needs phone connection all the time?

The official explanation: Your session on WhatsApp Web is an extension of WhatsApp on your phone. WhatsApp Web connects to your phone to sync messages, thus you can see all messages on both devices. Thus, the first requirement to being able to use WhatsApp Web is an active WhatsApp account on your smartphone. Source: https://www.whatsapp.com/faq/en/web/28080002 … Read more

PostgreSQL IN operator with subquery poor performance

Seems that I have finally found a solution: select * from view1 where view1.id = ANY( (select array(select ext_id from aggregate_table order by somedata limit 10) )::integer[] ) order by view1.somedata; After elaborating @Dukeling’s idea: I suspect where id in (1,2,3,4,5,6,7,8,9,10) can be optimised and where id in (select …) can’t, the reason being that … Read more

GHC’s RTS options for garbage collection

Generally speaking, garbage collection is a space/time tradeoff. Give the GC more space, and it will take less time. There are (many) other factors in play, cache in particular, but the space/time tradeoff is the most important one. The tradeoff works like this: the program allocates memory until it reaches some limit (decided by the … Read more

Is a statically linked executable faster than a dynamically linked executable?

Static linking produces a larger executable file than dynamic linking because it has to compile all of the library code directly into the executable. The benefit is a reduction in overhead from no longer having to call functions from a library, and anywhere from somewhat to noticeably faster load times. A dynamically linked executable will … Read more

At what point are WebSockets less efficient than Polling?

The whole point of a websocket connection is that you don’t ever have to ping the app for changes. Instead, the client just connects once and then the server can just directly send the client changes whenever they are available. The client never has to ask. The server just sends data when it’s available. For … Read more

What is the DOM Node Count in google chrome’s developer tools timeline memory view?

The DOM node count graph shows the number of created DOM nodes that are still held in memory, i.e. which have not been garbage collected yet. This doesn’t have to coincide with the elements you get through getElementsByTagName. The latter will also only get you the elements actually attached to the document tree. It won’t … Read more

Content-Length header versus chunked encoding

Use Content-Length, definitely. The server utilization from this will be almost nonexistent and the benefit to your users will be large. For dynamic content, it’s also quite simple to add compressed response support (gzip). That requires output buffering, which in turn gives you the content length. (not practical with file downloads or already compressed content … Read more