Clay Christensen used to tell a story about the atmosphere at HBS reunions over time. It sounds like this person learned early on the lesson that HBS graduates learn by their 25th reunion.
This makes me wonder if the whole North American cultural phenomenon of the age 40+ male "mid-life crisis" is the result of people independently discovering the same thing, from their own experiences and perspectives.
If you carefully read OP's response in the PR, he says he tried static typing make_list in addition to iterate_list. Your comment elides the resource allocation step.
Like OP, I observed that static typing make_list yields little benefit. It's runtime is 3x the runtime of iterate_list. And that makes sense. I'm not sure why we'd expect Cython to speed up the allocation of large numbers of Python objects.
But OP didn't type iterate_list either. Perhaps he saw little benefit on one and assumed the same would happen in the other. Cython's annotation mode (cython -a) doesn't really help either here, showing both OPs and optimized versions with a strong yellow color, indicating that they would be about the same, but compiling and trying both definitely shows the improvement.
Another funny thing: making a pure python version that uses the sum() built-in results in code that runs 80% as fast as the cython version, but also gives lower error (e-8 versus e-4 error that gets accumulated when the numbers are summed up one by one).
"A small number of unelected agents, operating largely behind closed doors, are increasingly important to the lives of millions who barely know of the existence much less the identity or inclinations of those agents."
A little bit of Python can fix at least that small part.
Tools to make GPU development easier are sorely needed.
I foolishly built an options pricing engine on top of PyTorch, thinking "oooh, it's a fast array library that supports CUDA transparently". Only to find out that array indexing is 100x slower than numpy.
You might be interested in Legate [1]. It supports the NumPy interface as a drop-in replacement, supports GPUs and also distributed machines. And you can see for yourself their performance results; they're not far off from hand-tuned MPI.
Interesting find about the indexing. I just had the opposite experience, swapped from numpy to torch in a project and got 2000x speedup on some indexing and basic maths wrapped in autodiff. And I haven't moved it onto cuda yet.
Here's an example that illustrates the phenomenon. If memory serves me right, index latency is superlinear in dimension count.
import time, torch
from itertools import product
N = 100
ten = torch.randn(N,N,N)
arr = ten.numpy()
def indexTimer(val):
start = time.time()
for i,j,k in product(range(N), range(N), range(N)):
x = val[i, j, k]
end = time.time()
print('{:.2f}'.format(end-start))
indexTimer(ten)
indexTimer(arr)
Ah, I'm guessing it's the loop that kills you. Arrays/tensors are supposed to be used as a whole, I imagine e.g. x=val**2 would be much faster.
I'm indexing one array with another e.g. x=y[z] to pull out all the values I want at once into another array for processing. And not using a python loop for the expensive part.
"In fact, I believe that those in power who snicker about credible reports of strange objects in the sky and stymie research into them, including access to classified data, have become a threat to national security themselves."
This seems to have become a deep-seated aspect of American culture. It extends into startup land as well. We on HN seem to be deeply skeptical of new applications of technology--like Dropbox and Coinbase--despite being highly receptive to developments lower in the abstraction hierarchy.
If you work in private equity, it's the worst. Your company isn't actively trading stock, but you still get banned from options, shorts, and need pre-clearance for every single trade. So you end up long SPY... even if you derive independent utility from actively managing your portfolio.
The law doesn't require this of course, but basically all money managers get their insider trading compliance program from the same 3 outside law firms.
Corn in the US is heavily subsidized. It's why corn syrup is so prevalent in US foods, because the subsidies mean it's cheaper than any other sources of sugar.
In the US, Iowa is the largest producer of corn [1] (producing nearly 40% more than the next, Illinois,) and thus the greatest beneficiary of those corn subsidies. Could we reduce those corn subsidies? No, it's politically nonviable, in part because Iowa has enshrined in its laws that it must have the first primaries in the US [2][3]. No candidate that has ever said anything against corn subsidies has won a primary.
This claim, often repeated, is misleading to the point of dishonesty.
Corn isn't really subsidized, and iowa corn farmers are not the benefactors of the agricultural bills. Cattle producers and chemical corporations are subsidized, and the way they're subsidized is by a myriad set of policies which encourage grain prices to stay very low. This makes cattle feed cheap and corn and soy inputs to chemical plants cheap.
If the price of corn doubled, farmers could afford to pay their mortgage and taxes without trying to extract every bit of possible yield. But then the price of beef would go up and the profits of 3M and Dupont would go down, and that's a far more powerful force than farmers in Iowa.
I'm kind of puzzled by this. Your post defies conventional wisdom (which you say is misleading). I'm giving you the benefit of the doubt because conventional wisdom is often misleading. But these links seem to indicate that in fact corn farmers ARE directly subsidized, both in terms of crop insurance (cheaper than market insurance is clearly a subsidy), as well as price protection. See that second link, especially ARC and PLC, which compensates farmers if their prices fall below benchmark rates set by Congress.
Is that not a direct subsidy? Are they wrong? (genuinely curious - your post is interesting enough that I felt I had to do some research to clarify my own thinking)
Subsidies have transitioned away from direct payments to subsidized insurance. The insurance isn’t just about natural disasters or crop loss, it guarantees minimum revenue based on farmed area, basically resulting in direct payments whenever prices are low. That has been successfully rebranded as “not a subsidy”.
The second link here is a deeply biased political position advocacy opinion piece, so it's a little bit onerous to 'refute' because every section is sort of a misleading half-truth. (I'm not sure what the best example would be, but I'm sure you've read something before where an author was cherry-picking statistics or casting factual elements in dishonest light so that they could support their stance, whether that was about vaccines or immigration or encryption or guns or whatever).
One thing that it does get right, is the section "they induce overproduction, inflate land prices, and harm the environment" which is absolutely true. My point in my previous post was that this systemic overproduction is to the benefit of corn buyers (cattle production, food processors, etc) and the detriment of corn producers.
In essence, the aggregate result of the myriad laws and programs impacting agricultural production is that grain producing farmers are left sitting helpless on a knife's edge. The only way to avoid bankruptcy is to pump your land full of petrochemicals to maximize yield. ARC is based on revenue, not profitability- it's encouraging high-cost, high-yield farming practices to guarantee plentiful grain supply to buyers. PLC is even more brazen- after completely distorting the true market price for animal feed by forcing grain growers to overproduce, we let them buy corn for less than it costs to grow and then force the farmers to rely on an insurance payment that's just enough to cover their debt & tax payments.
Basically, the grain producers are pawns in the ag subsidy game and the grain buyers are the kings.
I don't know much about direct corn subsidies, but we could talk about sugar tariffs -- which you could interpret as a subsidy to any substitute product producer -- like maybe corn syrup producers.
> Iowa has enshrined in its laws that it must have the first primaries in the US
I'm confused, how can a single state unilaterally require that its primary is the earliest in the nation? What's to prevent another state from passing a law that its primary must be one day before Iowa's?
They wouldn't have to. At the national conventions all delegates from states that go before iowa will be unable to vote by the existing rules and that limits what States would even be willing to try.
Does this mean that if another state organizes a primary earlier than Iowa's primary, that Iowa will reschedule their primary to be even earlier than the other state?
It’s my understanding that these subsidies came into existence in the Great Depression when farming was unprofitable even while people were starving. The government came to the realization that free market forces are not enough to stabilize the supply of food, and when food becomes unavailable... bad things happen. Car companies can go out of business and the country will survive, airlines can fail and the country will survive, movie theaters can go bankrupt and the country will survive, but food? That’s an existential crisis for the whole nation. When large masses of people start to starve, you’re looking at political change. You don’t fuck around with your food supply. You can’t just leave that up to supply and demand. Hence it’s subsidized and managed.
The government subsidies on corn pushes Iowa farmers to produce more than normal (depleting the soil faster) and sell their corn regardless of the market price. This is mostly done at the behest of other industries and huge food corporation lobbyists. It's a perverse economic incentive to say the least. I don't disagree with your conclusion, but I also don't think there's a bright line between corn subsidies and Iowa somehow playing kingmaker in the caucuses.
There’s a brilliant chapter in Sapiens: A Brief History of Humankind about how as we domesticated wheat, it domesticated humans in return. Grains are thought to have been dropped along trade routes which allowed for humans to be less nomadic as crops became established. Then we got comfortable. Fascinating to think about.
Supersonic cruise was an explicit design requirement for the F35, and it has been achieved using materials developed in the 1990s for the F22.
Your problem set sounds super cool, and it would be nice if DOD had a functioning acquisition process that would allow people with interesting tech to out-compete companies whose boards are stacked with current and former public officials. But alas, that's not the world we live in.
The sad thing is, there are probably dozens of proto Kelly Johnson's out there. But they've made defense industries so intolerable that none of them work there.
Is it the case that the nature of projects in the defence industry is such that companies are prone to consolidation into a few large contractors? In the case of pharma, given the length of time and billions needed to go from drug discovery to market means that only large companies can effectively do R&D. Is it similar for defence i.e., long development times mean only a few large companies can effectively compete? Or is the creation of oligopolies that don't allow for competition a very conscious aspect of government defence policy?
It's extremely easy for the government to accidentally create monopoly suppliers.
If Amazon signs a 5 year contract to get all their delivery trucks from Ford, GM isn't going to go out of business; and when they're re-negotiating the contract in 5 years time there'll still be a vibrant competitive market.
But if you make tanks or jet fighters or railroad rails, you might only have one customer. And if your only customer signs a 5 year deal with someone else, you're out of business.
Most of the consolidation has happened though because of ever more expensive weapons programs. A B52 is a lot dumber than an F35 and costs way less.
Similar trends took place in commercial aviation. There aren’t successful entrants into this market despite a lot of state backing, because it is now very hard and expensive to create an aircraft that matches the performance and efficiency of the latest models of Boeing and Airbus.
Drag increases significantly as the speed approaches Mach 1.0 (which is why commercial airliners stay below about Mach 0.8), but decreases significantly after that. So, just because a plane needs afterburners to attain supersonic speed doesn't mean it needs them to remain in supersonic flight.
"Honors is epaulets. My pop pop taught me that." -RPF