Live data from Hacker News

Top Checklists on HN

hn.algolia.com

11–20 of 30 posts

Re: Top Checklists on HN

#11
post #8

Earlier quoted context omitted.

Algolia and HackterNews (Y Combinator) are two different parties. Algolia implemented the HackerNews API (which is based on Firebase). Agolia uses their JavaScript library to enhance the user experience (for near instant search results).

General commentary based on your use of the words “enhance” and “near instant”: Especially in places of higher latency (e.g. Australia), using JavaScript for things like this does not enhance the user experience, but rather increases the delay, because additional round trips are required, especially when it’s over TLS on a different host as in this case. On a good connection at these latencies (~300ms), these near in…

I think you can get around these problems:

Algola has something they call a DSN that runs your search backed all over the word. So you have good latency's. [https://www.algolia.com/infra]

Additionally you could bundle only what you use in there library to make the page lighter.

Re: Top Checklists on HN

#13
post #8

Earlier quoted context omitted.

Algolia and HackterNews (Y Combinator) are two different parties. Algolia implemented the HackerNews API (which is based on Firebase). Agolia uses their JavaScript library to enhance the user experience (for near instant search results).

General commentary based on your use of the words “enhance” and “near instant”: Especially in places of higher latency (e.g. Australia), using JavaScript for things like this does not enhance the user experience, but rather increases the delay, because additional round trips are required, especially when it’s over TLS on a different host as in this case. On a good connection at these latencies (~300ms), these near in…

I really wish people would actively avoid the fancy JavaScript SPA approach. (And I work on such an SPA.) There’s a place for them, but this is not a good demo of that place.

Or just have a button somewhere for a "basic HTML" version.

Why are modern developers and UX designers so averse to giving users control over their experience?

Re: Top Checklists on HN

#15

Earlier quoted context omitted.

General commentary based on your use of the words “enhance” and “near instant”: Especially in places of higher latency (e.g. Australia), using JavaScript for things like this does not enhance the user experience, but rather increases the delay, because additional round trips are required, especially when it’s over TLS on a different host as in this case. On a good connection at these latencies (~300ms), these near in…

I think a JS SPA is a good fit for this. A common search use case is trying to find something obscure, which usually takes a few different searches. Once you've loaded up the SPA once (ie. your 4 second delay), you are able to do multiple searches quite rapidly as the subsequent post requests are tiny (3kb out 16kb in), new DNS resolution / TLS connections won't be required for at least a few minutes. So if I'm doing…

>Once you've loaded up the SPA once (ie. your 4 second delay), you are able to do multiple searches quite rapidly as the subsequent post requests are tiny

I don't think parent poster is talking about initial page load. Instead, the search page's javascript intercepts every keydown event so you would suffer 4 second round-trip delay for every keystroke. (You can go see this in browser's developer tools by setting a breakpoint on the keydown event.)

Instead of this:

  [4 seconds] page load done, type "Ruby"
It's this:

  R [4 seconds] u [4 seconds] b [4 seconds] y [4 seconds]
More examples of this keydown latency frustration are retail websites like homedepot.com and lowes.com. When you're at home on a fast fiber optic connection, the keydown events work fine. (Customers generally like the "autocomplete" feature that the keydown javascript code enables.) However, when I'm at the store with a mobile phone on a slow 3G connection, each keydown takes 5 seconds and it makes it impossible to use the website.

Re: Top Checklists on HN

#16
This is a great way to find many great posts and learn from HN:

"things i learned" https://hn.algolia.com/?query=things%20i%20learned&sort=byPo...

"wish someone told" https://hn.algolia.com/?query=wish%20someone%20told&sort=byP...

"how did you" https://hn.algolia.com/?query=how%20did%20you&sort=byPopular...

I'm sure there are many others like this too!

Re: Top Checklists on HN

#17
post #15

Earlier quoted context omitted.

I think a JS SPA is a good fit for this. A common search use case is trying to find something obscure, which usually takes a few different searches. Once you've loaded up the SPA once (ie. your 4 second delay), you are able to do multiple searches quite rapidly as the subsequent post requests are tiny (3kb out 16kb in), new DNS resolution / TLS connections won't be required for at least a few minutes. So if I'm doing…

>Once you've loaded up the SPA once (ie. your 4 second delay), you are able to do multiple searches quite rapidly as the subsequent post requests are tiny I don't think parent poster is talking about initial page load. Instead, the search page's javascript intercepts every keydown event so you would suffer 4 second round-trip delay for every keystroke . (You can go see this in browser's developer tools by setting a b…

I don't think that's right, at least for algolia (maybe others are implemented badly):

- The latency for this query will never be 4 seconds (it's a tiny request/response, TLS connection is open already etc.)

- There's throttling applied so if you're typing it won't send the request until you've finished typing

- You don't have to wait for the previous response to come back to type another letter

Finally, the real time searching means you'll probably find what you're after faster as you don't have to complete the full word for it to appear.

Re: Top Checklists on HN

#18

Earlier quoted context omitted.

General commentary based on your use of the words “enhance” and “near instant”: Especially in places of higher latency (e.g. Australia), using JavaScript for things like this does not enhance the user experience, but rather increases the delay, because additional round trips are required, especially when it’s over TLS on a different host as in this case. On a good connection at these latencies (~300ms), these near in…

I think you can get around these problems: Algola has something they call a DSN that runs your search backed all over the word. So you have good latency's. [ https://www.algolia.com/infra ] Additionally you could bundle only what you use in there library to make the page lighter.

But by the looks of it, the search backend isn’t being run all over the world, else latency would be decent.

The vast majority of the JavaScript is superfluous third-party libraries like AngularJS. The actual app is under 2,000 lines of code. I do not expect it would be difficult to cut the frameworks out of it at all, for a lighter and faster experience that only weighed a few kilobytes.

Re: Top Checklists on HN

#19

Earlier quoted context omitted.

General commentary based on your use of the words “enhance” and “near instant”: Especially in places of higher latency (e.g. Australia), using JavaScript for things like this does not enhance the user experience, but rather increases the delay, because additional round trips are required, especially when it’s over TLS on a different host as in this case. On a good connection at these latencies (~300ms), these near in…

I think a JS SPA is a good fit for this. A common search use case is trying to find something obscure, which usually takes a few different searches. Once you've loaded up the SPA once (ie. your 4 second delay), you are able to do multiple searches quite rapidly as the subsequent post requests are tiny (3kb out 16kb in), new DNS resolution / TLS connections won't be required for at least a few minutes. So if I'm doing…

Your argument is entirely unsound.

The cost difference between producing JSON and producing full HTML should be negligible, half a millisecond at most, and only a few extra kilobytes to the response (still tiny). (I’m deliberately ignoring the question of whether Algolia can emit HTML, talking rather about a theoretical system, or a system that proxied Algolia to sort that part out.) And the extra CSS and JavaScript required should be trivial.

Therefore, the difference between a full page load and slurping JSON and crafting a new DOM should be a matter of a few milliseconds at most. (And you can add a tiny JS handler that does the new page load as XHR and just replaces the body without needing to reparse any JS and CSS to shave most of those few milliseconds off if you are so disposed.)

As I assess it, the benefits of the JS SPA are a few milliseconds on each search—a frame or two at the most.

But the costs are that the first search is very slow, twice as slow in the best-case scenario (due to using a different domain—if the same domain was used, the absolute best case would only be ~33% slower, more like 40% in practice) and much worse on slow devices or higher latency environments.

The first search is the most important one and the most common one. To be sure, some will perform multiple searches, but most sessions will involve only one search.

In summary: the SPA approach has marginal benefits but severe downsides. It is not necessary or desirable for a web app like this.

Re: Top Checklists on HN

#20
post #15

Earlier quoted context omitted.

I think a JS SPA is a good fit for this. A common search use case is trying to find something obscure, which usually takes a few different searches. Once you've loaded up the SPA once (ie. your 4 second delay), you are able to do multiple searches quite rapidly as the subsequent post requests are tiny (3kb out 16kb in), new DNS resolution / TLS connections won't be required for at least a few minutes. So if I'm doing…

>Once you've loaded up the SPA once (ie. your 4 second delay), you are able to do multiple searches quite rapidly as the subsequent post requests are tiny I don't think parent poster is talking about initial page load. Instead, the search page's javascript intercepts every keydown event so you would suffer 4 second round-trip delay for every keystroke . (You can go see this in browser's developer tools by setting a b…

Nah, the four seconds is just when it has no open connection. Provided there is an open connection (that is, you performed a search on that instance of the page in the last minute or so), searching is just one round trip away—sure, latency to Canada is a few hundred milliseconds, but you’re not going to get any faster than that without edge searching.
Post reply on HN