Better HN
topnewbestaskshowjobs
Log inSign up

coder543

6,699 karma · joined Jul 18, 2012 (14y ago) · 1,967 submissions

My email is at gmail using my username.

Backend-focused full-stack engineer with 8+ years of experience, mostly focused on Go, Rust, and TypeScript, but open to other options.

Resume: https://drive.google.com/file/d/1VNC272B3n7ZEfppMHkm2wGgaINwYl4Av/view

Submissions

comment 4y ago · link · parent

> They pay for enormous capacity that is used only sporadically.

In this day and age? I am highly skeptical.

Any large, upcoming surge of traffic is planned in advance, as in the case of the Taylor Swift Era Tour ticket sales, so they can easily preemptively scale up infrastructure ahead of that. There is zero reason to hold onto that infrastructure all year long, and dynamic scaling works fine for this type of service the rest of the year.

comment 4y ago · link · parent

I don’t think we’re on the same page about what midstack inlining is being used for in my suggestion. This discussion is about eliminating a heap allocation, which as far as I understand, RVO never does. Please read the article I linked if you want to discuss this further. I don’t want to repeat the article pointlessly.

I’m also fairly sure Go uses RVO here too, which cuts down on the number of times the object is copied around, but again, it’s irrelevant to the discussion of heap allocations. Copying the object isn’t the performance problem here, needlessly allocating a very short-lived object on the heap over and over is.

comment 4y ago · link · parent

There is potentially another option: use the midstack inliner to move the allocation from the heap to the stack of the calling function: https://words.filippo.io/efficient-go-apis-with-the-inliner/

As long as the global slice is never mutated, the current approach is probably fine, but it is definitely a semantic change to the code.

comment 4y ago · link · parent

Nebula is Nreal's proprietary virtual workspace. DeX is a feature offered on many mid-to-high-end Samsung phones where you can plug it into an external monitor, mouse, and keyboard and get an Android-based desktop-style experience with draggable, resizable windows.

comment 4y ago · link · parent

As noted elsewhere in this discussion, the Nreal Air glasses already offer 49ppd, which is way higher than the VR headsets on that chart. I haven't gotten to try them out yet, but they seem interesting.

comment 4y ago · link · parent

> it doesn't support AR monitors

At the top of this thread, the youtube video linked by that comment shows AR monitors on a Mac at 7:24 in the video. The software support for that isn't there on iOS or iPadOS, but it is supported on Mac, apparently. (And Android, as you noted.)

comment 4y ago · link · parent

Much better to just go in and turn on Settings -> Camera -> Macro Control

comment 4y ago · link · parent

Quad Bayer: https://www.dpreview.com/files/p/articles/4088675984/Quad_Ba...

The 48MP sensor still has 48MP of monochromatic resolution, but it only has 12MP of effective color resolution. You'll still see fine details, but the colors are not as high resolution as the details. This is rarely a problem, given the way the human eye processes color.

comment 4y ago · link · parent

If you take a photo of a subject that is closer than 7.8 inches, you're no longer using the main camera on the 14 Pro. It automatically switches to the ultrawide camera and crops in to show the same field of view. I suspect that is happening to you in some cases, but you're unaware, based on the fact that you didn't mention anything about this limit.

The 48MP camera has the same color spatial resolution as a 12MP camera, but it has 48MP of monochromatic spatial resolution. Humans aren't as sensitive to color resolution as they are to spatial resolution in general. This is why the "2x" mode on the 14 Pro look great compared to what you might expect based on your comment. The 2x crop only has "3MP" of color resolution, but the 12MP of spatial resolution from the 2x crop makes it perfectly usable.

For your specific use case, the ultrawide camera may work fine as a "macro" lens, depending on the size of the pixels you're trying to capture. A real macro lens on an interchangeable lens camera would obviously do better.

comment 4y ago · link · parent

I'm just going to mention that NATS can be used as a general purpose transport, with encryption and a surprisingly capable authentication and authorization system. It also supports federating into clusters and superclusters. NATS has also come a long way in the last several years, in case anyone is thinking of some experiences they had years ago when it didn't have all these features.

The question would have to be "what does your idea/project offer that NATS doesn't already offer?"

I have no affiliation with NATS, but I wish that people were paying more attention to it. It solves a lot of problems people have.

comment 4y ago · link · parent

Aren’t BiDi transceivers usually a good bit more expensive, especially compared to how low the material cost of fiber is? What’s your use case for BiDi? I don’t have a lot of first hand experience with this stuff, though. I can easily imagine BiDi being useful to retrofit/repurpose some existing fiber, since labor costs can be a lot.

comment 4y ago · link · parent

Unless I'm reading this wrong, it looks like Mozilla has been working on OPFS support for the last 10 months or so: https://bugzilla.mozilla.org/show_bug.cgi?id=1748667

No telling when it will be ready, but it's encouraging that they seem to be working on it.

comment 4y ago · link · parent

That makes sense, although these topics could still potentially be mentioned in the documentation.

comment 4y ago · link · parent

I feel like Google Chrome shipped an experiment at one point that was going to include some of the most popular libraries with the browser, so they would be equally cached for all Chrome users, for all sites. I'm having trouble finding any announcements about this, so maybe I dreamed this up.

comment 4y ago · link · parent

Google, Apple, and Mozilla apparently all failed to find a solution to this problem, even though lots of people wanted there to be a solution. Certainly, any browser that shipped this feature in a privacy-respecting manner would have bragging rights for awhile, so there is an incentive. Given that, I don't think I'm exaggerating the difficulty of the problem. This problem is also very similar to the challenges brought by Spectre-class vulnerabilities, and that one has been enormously costly for the whole industry.

I think it is completely fair to say that privacy-respecting shared caches are not simple.

Some solutions can be imagined, but they come with weird trade-offs or they do nothing for majority of the web. A new manifest format like you describe falls into the latter, since it would only apply to new websites using the new feature, and that’s without digging into the other problems it would pose.

In practice, people often visit the same websites repeatedly; they aren't constantly visiting new websites only once. A partitioned cache works just fine for the normal scenario. It's slightly less efficient for the first day someone uses their browser, but then things are honestly fine after that. It's unfortunate that we can't eek out the last tiny bit of performance for this, but I think the difference would be hard to measure in practice.

In my opinion, if websites would more commonly use brotli, that would make a far larger difference in efficiency than returning to a shared cache, and if browsers could have a standardized means of downloading only the bytes that changed in an asset like a javascript library instead of downloading the new version from scratch, that would make a much bigger difference too.

comment 4y ago · link · parent

> Do I think it should stand in the way of a functional internet? Not really.

We have a functional internet. I'm using it to communicate right now.

comment 4y ago · link · parent

> The privacy problem is not a result of the shared dependency, it's a result of the shared cookies.

No, it's not the result of the shared cookies. You just ignored all of the timing attacks and fingerprinting which a shared cache allows, as those articles discuss.

The cookie thing is honestly completely irrelevant to the topic of privacy, if you understand how the shared cache used to work. If you loaded the same library from separate CDNs on different websites, the shared cache didn't come into play at all. The library was loaded twice anyways. There was no chance for cookies from different CDNs to accidentally cross the streams. Browsers weren't attempting to heuristically determine if you were trying to load the same asset from different hosts.

The shared cache only came into play if you loaded the same asset from the same third-party CDN on multiple websites. The host serving an asset is the one responsible for setting the cookies, and sharing the cookies is helpful in that case, since the same CDN is the host serving the asset to the browser for both websites. These aren't cookies controlled by separate websites, they're cookies supplied by the CDN, and they should be the same for both requests anyways, outside of maybe some remote possibility of a theoretical attack involving a malicious CDN intentionally setting some weird request-dependent cookies, but I can't see how that would even do anything harmful anyways. So, the cookies get shared because the browser is serving a cached response for the same asset from the same host to both sites, which makes sense.

So, cookies aren't the problem here, and they're not the reason the shared cache was partitioned. If you want browsers to undo that in any form, you would have to solve the actual privacy problems here.

comment 4y ago · link · parent

Signing dependencies is related to integrity, which is orthogonal to privacy.

Sharing a cache between websites has proven to be a privacy issue.

Read more here: https://developer.chrome.com/en/blog/http-cache-partitioning...

or here: https://www.peakhour.io/blog/cache-partitioning-firefox-chro...

comment 4y ago · link · parent

I agree. I said:

> so it is effectively a one time penalty for a given website

which shows that I already acknowledged the demise of cross-origin caching.

Each website the user visits that uses this library has to pay a 266KB penalty once, which isn't that bad. (Well, once, unless the site developer decides to upgrade the library, then the penalty applies once more, but that's expected behavior.)

comment 4y ago · link · parent

"Hefty"... for an asset that can easily be cached long term, so it is effectively a one time penalty for a given website, and many web apps will load images larger than this. Certainly, just about any marketing/product page will load more bytes than this in the form of images, let alone videos.

So, "hefty" seems like a bit of an exaggeration to me. All other things equal, lighter is always better, but 266KB for all the functionality SQLite offers isn't that bad, IMO.

On the topic of caching, since SQLite is (intentionally or not) going to be setting an example with their docs and demos[0], I would suggest that SQLite should demonstrate the industry best practices with regards to caching as well. Static assets like WASM and JavaScript should be served with a very high cache duration, and the name of the asset should include a hash of the asset. This way, the site maintainer can update the HTML to reference the new SQLite bundles by the new hash whenever they upload new versions, and browsers will immediately request the new versions, but they will otherwise instantly load the cached version after the first visit whenever there isn't a new version.

[0]: https://sqlite.org/wasm/doc/trunk/demo-123.md

comment 4y ago · link · parent

As a little pro-tip, the demos appear to be serving a gzip compressed WASM file, but offering a brotli compressed version for clients that say they accept it would be even better:

    665K sqlite3.wasm
    306K sqlite3.wasm.gz (-54% compared to uncompressed)
    266K sqlite3.wasm.br (-13% compared to gz, -60% compared to uncompressed)

comment 4y ago · link · parent

The level of optimization available back then is a far cry from what we have today, as far as I've ever heard or seen. Based on looking at some histories of GCC, the EGCS fork in 1997 was responsible for starting to introduce meaningful optimizations into GCC, such as global CSE (common subexpression elimination), and that wasn’t merged back into mainline GCC until years later. LLVM didn’t really hit its stride until late 2000s, and I believe it was used as a research platform to develop a lot of the modern optimizations that exist today.

Do you want to be more specific about the kinds of optimizations that existed in GCC in ~1995? My understanding could be incomplete or wrong, but today's compilers aren’t just twiddling their thumbs and using tons of RAM. They’re doing useful work that simply didn’t happen back then. As with all software, there is surely room for improvement even today, both with the implementations of the compilers and with the optimizations that are being done.

Peephole optimizations (and efficient register allocation) would probably have been very helpful for RISC, and I’m guessing that’s what you’re referring to, but that’s a comparatively simple level of optimization that requires little RAM or heuristic analysis.

comment 4y ago · link · parent

> It was only a few years back and we were building C++ compilers on machines with barely 16MB.

"A few years" seems like a serious understatement, but beyond that... compilers in the time period you're talking about weren't really doing optimizations, they were just shoveling assembly out the door. Doing very little work takes very few resources, but the resulting binaries were way slower than they could have been. Any compiler that uses LLVM tends to be slow, in my experience, but it does offer excellent optimizations.

comment 4y ago · link · parent

If you enable the path bar, you can right click on the path bar and "Copy as Pathname" on whatever is down there (which will be the current folder if nothing is selected, or whatever is selected).

If the path bar is showing a folder, you can right click it and select "Open in terminal".

comment 4y ago · link · parent

Once again, you ignore the only question that matters in this thread. You also prove my own point: the press release under discussion was targeted at the U.S., as the default Newsroom is the one used for U.S. press releases. Unless you care to link to Apple's U.S. Newsroom? The one you linked is targeted at Singapore, as can be seen clearly. Apple customizes it to each region where there is a need to customize it. For the comparison to be misleading, we would need evidence that it is misleading at least in one country where they released this press release, and it isn't misleading in the US based on the evidence previously shown so far, as best I can tell. I had welcomed you to show some evidence as well, but you haven't.

This whole discussion has been pointless.

comment 4y ago · link · parent

You’re completely ignoring points which don’t agree with you.

The Galaxy Tab A7 Lite uses the exact chip in the comparison and is an extremely well-selling tablet in America, and likely worldwide. The new iPad is definitely 5x faster in some benchmarks I checked compared to one of the Amazon fire tablets I saw on sale, which is also extremely popular. That’s two of the most popular tablets I’m aware of, and other tablets in these price ranges don’t appear any more powerful.

This indicates that their comparison is not misleading, full stop. We don’t really need more data to prove their comparison seems adequate. Apple didn’t set up a strawman.

You’re not providing any evidence to your claim that it is misleading. Just because you don’t like a comparison doesn’t make it misleading.

The press release also states Cupertino, California, but I don’t see where it says it is worldwide as you claim. It is reasonable to assume that a press release by a U.S. company being released from a U.S. office is intended for a U.S. audience. I don’t see any mention of euros or other non-U.S. currencies in the press release, but they do mention dollars and they specifically refer to the U.S. several times. If it is targeting the U.S., then the comparison should be against the U.S., and it appears to be perfectly relevant against some of the best selling Android tablets here. There is no need to stretch for some brand only sold in China, as you did in your analogy. (I don’t have the market research they have in order to determine which one is the best selling, but the A7 Lite seems like a solid bet as the one Apple concluded.)

What evidence do you have that the best-selling Android tablet in America is significantly faster than the Samsung Galaxy Tab A7 Lite? That’s the only question that is relevant to this discussion. Apple’s claims appear to be spot-on for the U.S. market based on my own quick research. Baseless claims of a company intentionally being misleading are pointless to debate, so I’m done here. I’m happy to criticize Apple for all sorts of things, including their tendency to hamstring PWAs to promote their App Store monopoly, but this tablet performance comparison appears perfectly fine.

comment 4y ago · link · parent

You’re setting up a strawman which is easy for you to knock over. I specifically said “best-selling car in America”, which would not be from a Chinese brand. It appears to be the Toyota Camry, but whatever it is, it is certainly going to be similar to other well-selling, similarly-priced vehicles the average US reader would be familiar with, whether that is a Honda Civic or Subaru Impreza or whatever.

Without seeing Apple’s market research data, which you also haven’t seen, they likely concluded that the best selling Android tablet in America is a cheap tablet sold at Walmart or Amazon. Do you really think the new iPad isn’t up to 5x faster than the best-selling Fire tablet on Amazon? As someone else pointed out, the Samsung Galaxy Tab A7 Lite uses the exact chip mentioned in the comparison, and it has 10k reviews on the Amazon storefront. This is not some no-name tablet only sold in China.

If Apple were comparing against tablets only sold in China in a US press release, and if those tablets were significantly weaker than the best selling Android tablet in America, then yes, it would be misleading, but I have seen no evidence to indicate that, and I don’t believe that’s what happened here.

The upvotes I’ve gotten are enough to indicate this isn’t likely to be a bad look for Apple. Plus, even if you consider it misleading, this is only in a press release, it isn’t even on the product page that people will actually see. But no evidence has been presented that Apple chose to be misleading. This comparison seems perfectly fine.

comment 4y ago · link · parent

> most people reading Apple's comparison will think that it is 5 times faster than fastest Android tablet and this is exactly what they're aiming for

That is such a wild conclusion. Apple clearly says "best-selling" right in the claim. They didn't hide it in a footnote. I believe that "best-selling" is not a difficult concept to understand for most people, and I struggle to think of a better way for Apple to have worded things there. If BMW compared one of their new vehicles to the best-selling car in America, who is going think BMW is intending for the reader to compare against a Bugatti Chiron? That is not what anyone would conclude, and it's the same here.. no one should immediately conclude that Apple is comparing to the fastest Android tablet when they clearly say "best-selling".

Since you apparently believe most people can't read (or at least, can't understand the words "best-selling"), there's probably nothing Apple could have written that would have worked for you here. The comparison against the class of android tablet that the reader is most likely to have is an extremely valid one.

comment 4y ago · link · parent

Taking the footnote out of context makes it look sillier than it is. Here is the actual quote where the footnote was used:

> This makes the new iPad up to 5x faster than the best-selling Android tablet, and for users looking to upgrade from a device like iPad (7th generation), they will see up to 3x improvement in overall performance with the new iPad.

The footnote also mentions this immediately after your quote ends, which you presumably left out because it would have made the theme of the above quote more obvious and less confusing:

> Best-selling systems are based on publicly available sales data over the last 12 months.

If Apple clearly states they are comparing to "the best-selling Android tablet", and they do, then I don't see what the problem is. They didn't say "compared to the fastest Android tablet" and then whip out the old MT8768 or some nonsense like that. The reader is welcome to disregard the comparison, but the comparison isn't misleading.

The basic iPad has surely been Apple's best selling iPad for a long time, so that is Apple's point of comparison for this one. If they wanted to compare absolute performance against the best the Android tablet market has to offer, they would use the iPad Pro with the M2 chip, not the basic iPad.

I would also point out that anecdotally, I don't know a single person with an Android tablet that cost $200 or more. I know plenty of people with Android tablets that cost way less than $200. Most people reading Apple's comparison who have an Android tablet will be trying to understand why they should pay the premium for an iPad instead of buying another $100 tablet, and being 5x faster is a logical hook. People with a $400+ Android tablet are unlikely to be considering a basic iPad, since they've clearly already made up their mind.

1
353637
66