HNHacker News
TopNewBestAskShowJobs

jzwinck

5,693 karma · joined December 14, 2011

submissionscomments
jzwinck··on Why is this C++ code faster than my hand-written assembly (2016)
> Pathologically-slow ASM is pretty rare from modern compilers

Here are some I've found:

https://stackoverflow.com/questions/45496987/gcc-optimizes-f... (horrific codegen for known-size C++11 loops in member functions, all GCC versions prior to 8 which is not yet released)

https://stackoverflow.com/questions/43651923/gcc-fails-to-op... (SIMD opportunity squandered when C++11 features are used)

https://stackoverflow.com/questions/42263537/gcc-sometimes-d... (failure to inline trivial operators)

https://stackoverflow.com/questions/26052640/why-does-gcc-im... (C isnan() not efficient, for many years)

jzwinck··on Why PS4 downloads are so slow
There is a standard way to embed any file into an ELF. The program "objcopy" creates object files from arbitrary input files. You then simply link the objects into your executable. The program can then access those arbitrary embedded data chunks by their symbol names, just as if they were literal strings in the source code.

I explain how to do this in the context of embedding a version file here: https://stackoverflow.com/questions/16349557/does-gcc-have-a...

jzwinck··on Why PS4 downloads are so slow
Definitely. And that "quick hack by default" person will often end up being the favorite of management because they get so many things "done."

So it's important to figure out what kind of manager you have, and try not to be the slow guy on a team full of quick-hack people. You won't look good and nobody will be happy.

jzwinck··on Let's Remove the Global Interpreter Lock
Why are you asking this using a throwaway?

np.dot() is multicore. np.load () (and family) releases the GIL. SIMD mostly depends on the build system, so if you want it you might need to build NumPy from source.

https://stackoverflow.com/questions/24022723/where-can-i-fin...

jzwinck··on Let's Remove the Global Interpreter Lock
While a lot of NumPy is C and Fortran, Pandas is mostly pure Python and some Cython. And mostly it does not release the GIL.

You often end up having to implement your own C extensions or use Numba for the core of your processing. Even with BLAS enabled, NumPy has almost zero intrinsic parallelism, np.dot() being the notable exception which releases the GIL and uses multicore by itself.

jzwinck··on Twilio – Why there's no API for crossing the chasm
I work in sales at Twilio and manage the account of a huge enterprise customer. We've sold to a few of their departments and what we've done so far has been successful.

But every time I call my contacts at this customer, something seems to derail us from the path to further integrations. They know our products work and save them money. But just last week I called Glenda in accounting only to find out her phone number now goes to some guy named Bob who refused to tell me what desk he works on or what happened to Glenda.

So I fired off a quick email to Vincent, the CIO, asking for an updated contact list since Glenda is gone and I heard Sally moved to outside sales. Vincent's secretary wrote back to me saying she'd "ping" him and "circle back". That was two weeks ago.

Last year when we closed a bunch of deals with this company I was recommending to my management that we spend even more effort to get further with them this year. But here I am halfway through the year and I feel lucky that my proposal was turned down because we were already too busy with other clients. What would another sales guy have done anyway, apart from dogfooding our sweet new IP phone stack as he wasted his time trying to navigate an endless megacorporate morass?

jzwinck··on Airbnb In Amsterdam
Correct title is "Airbnb in Amsterdam."

There is an obvious lack of data cleaning here. You can see from the first places drawn on the map that a lot of them are duplicated. I don't think that many people have multiple dwellings in the same area.

jzwinck··on Exotic Data Structures (2011)
No. std::deque is like a vector of small arrays. Small meaning 32 to 512 bytes or one T if larger. Compact dynamic arrays have sub-arrays which can be larger and can be dynamically sized.

The small fixed size of the sub-arrays in std::deque is basically a defect making the container a lot less useful.

jzwinck··on Car Cost per Year - New vs Used
I will bet against you here and now. In July 2027, I bet at least 5% of new cars sold in the US will not have full self-driving capability. Meaning they will be unable to drive between two arbitrary street addresses in the US without a licensed human operator.
jzwinck··on 999: The world's oldest emergency services phone number
I used rotary phones too. They looked like this: https://www.outsideopen.com/wp-content/uploads/2015/01/IMG_0... and this: https://img1.etsystatic.com/004/0/6113020/il_fullxfull.35452... and this: https://img0.etsystatic.com/141/0/9295718/il_340x270.1171692...

What did yours look like?

jzwinck··on 999: The world's oldest emergency services phone number
If you look at images of rotary phone dials I think you will see that it is 0 and 1 that can be dialed easily without vision. Only in New Zealand can 9 be dialed so easily (they use a different dial, however unbelievably).
jzwinck··on Ask HN: What happened to the ORM?
I mostly use this now: https://pandas.pydata.org/pandas-docs/stable/generated/panda...

Which is basically an easy to use API that turns a SQL query into an efficient columnar table in memory.

Yes, this still requires writing actual SQL. And yes it does not help you insert or update data. But for 95% of uses it works well.

jzwinck··on GDAX will restore the balance of margin called users with company funds
Presumably a circuit breaker. Many exchanges have these now. The Japanese stock exchange has a particularly nice one which pauses every 3% for people to think about what they are doing. That makes stop loss orders behave more in line with people's expectations.
jzwinck··on Trump administration has plan to scrap ‘startup visa’ rule
"Investor" visas exist in many countries. Eliminating it in the US would result in US people being excluded in other countries. And if there is one thing rich people aren't going to vote/lobby for, it is curtailment of their ability to migrate.
jzwinck··on NumPy receives first ever funding, thanks to Moore Foundation
Tons of people still use QuickFIX. As I think you know, people very concerned with speed try to avoid using any kind of FIX for trading but still use QuickFIX for things outside the hot path such as drop copy (duplicate stream of trades for reliability).

QuickFIX is open source too, so you can make it somewhat faster without abandoning it. I did.

jzwinck··on PCIe 4.0 will be twice as fast as today's slots
You're both right. Individual electrons can move at high speeds (not c), but the overall flow of electrons in a wire is very slow. This happens because individuals move in random directions but the group has a slow push with the current.

Imagine people going to the shopping mall. Once in a while someone goes in and an hour or two later they come out the other door 10m away. But they travelled a lot more than 10m. You just didn't notice from outside.

jzwinck··on Can you figure out how this single part boost converter works?
Here is the code that made him famous: http://www.josh.com/notes/island-ecn-10th-birthday/

I enjoyed the part where it rounds an order quantity to a multiple of 100 by using string operations. A comment there explains it's to avoid floating point ops. Ah the good old days.

jzwinck··on L.A.'s crisis: High rents, low pay, and $2k doesn't buy much
If your home becomes much more valuable in 2018 to 2028 but then falls sharply in 2029 to 2034 and you become ill in 2035, who will pay the high tax then due?

What you propose is basically an additional mortgage via the state. This means more leverage for home owners and increased risk for the state. When a broad downturn comes, the state will be shoved briskly toward bankruptcy.

jzwinck··on Ask HN: Who is hiring? (June 2017)
DRW | Trading Platform Software Engineer | Singapore | ONSITE | https://drw.com/careers

We are an office of a global proprietary trading firm headquartered in Chicago. This position is in Singapore, and the ideal candidate will be here already.

We mostly use C++, with some Python and a bit of Javascript. This position will be 80% C++. Performance and reliability are very important to us.

Here’s a quick quiz you can take (make sure to use a working email address): http://proveit.drw.com/?code=kdvsoi (Takes less than 15 minutes, will be closed later this week.)

You’re welcome to email me directly at my username at drwsg.com.

jzwinck··on CVE-2017-1000367 in Sudo's get_process_ttyname() for Linux
Not really relevant. The main bug being discussed is a text parsing bug related to syntax, not memory access errors or the like. Rust seems cool and all but it isn't immune to logical errors.
jzwinck··on China's 'sharing economy' booms, but can it last?
I don't know about renting basketballs but I do believe in bicycle sharing schemes. The article mentions the fairly recent entries in Singapore of "stationless" rental bikes, and I have seen first hand how this is going.

Sharing is appealing. And thanks to VC money, it's cheap. But as soon as it goes from a small local thing with passionate users to a big business with a big cross section of the overall population, dynamics change.

In Singapore the sharing companies are the present beneficiaries of a government "wait and see" period. The more popular they become, the more incidents occur that will do them no favours. Bikes dumped in rivers. Bikes parked in car traffic lanes on busy roads. Bikes parked in residential racks. Bikes hidden from view to prevent sharing.

This is ugly. This is what it looks like when your shared goods are widely adopted with no expensive enforcement. This is happening in Singapore, one of the most rule-abiding, nice cities in the world.

You want a million customers? The woodwork is buzzing.

jzwinck··on Libtins – High-level and multiplatform C++ network packet sniffing and crafting
A more charitable reading of my comment would be that I am recommending the use of "if" instead of C++ exceptions for hot-path control flow in high-performance libraries.

Heuristic construction of a packet filter based on previously seen exceptions is infeasible with the current API because rejection of the first N non-TCP packets does not guarantee rejection of the next one.

jzwinck··on Libtins – High-level and multiplatform C++ network packet sniffing and crafting
The linked page says "High level != inefficient" and shows an example program which will print "every TCP packet".

With no "if" anywhere in the code, I wondered how it knew to print only TCP packets and not others. And the answer turns out to be that it throws a C++ exception on every non-TCP packet!

If most of the packets on your network are TCP, this is sort of OK. But if you have mostly non-TCP packets, this toy program costs about 10x the CPU utilization that it would if it used "if" instead of magic.

jzwinck··on Go and a not tiny amount of memory
So you use a GC and have occasional CPU usage spikes. You correctly identify the cause. You then use "unsafe" code to go behind the GC's back and build some stuff which probably has crash bugs or worse, and by your analysis solves a problem which was not significant.

I shouldn't be surprised. The red flag was flying as soon as IOP was used in singular form.

Input/Output Operations Per.

jzwinck··on The Quants Run Wall Street Now
Major ones include R, Python, Matlab, and K/Q, roughly in that order of current popularity. Matlab used to have more marketshare and Python less.
jzwinck··on Americans Are Paying $38 to Collect $1 of Student Debt
Don't you see the connection? School fees are high partly because people can get free money to pay them. This of course screws the people who do not take the free money by defaulting on loans.
jzwinck··on A new sort of hedge fund relies on crowd-sourcing
All automated trading technology providers suffer this paradox: failing customers will fail, excellent ones will profit and move on to develop their own platforms. It's unavoidable. You must continually attract new customers and hope some are successful for your own reputation.
jzwinck··on The Horror in the Standard Library
With the status quo, say you call malloc() once. After a long while you call free(). Now the first thing free() needs to do is figure out the size, which is stored "before" the pointer. Until that load is complete, it can't know how large the allocation was, so it can't prefetch other necessary data, e.g. the free list for a given chunk size. This could add 120 cycles of latency to get a value that the caller probably already had in L1 cache or could compute with a single multiply.
jzwinck··on C++ Language Interface Foundation (CLIF)
Having used both SWIG and Boost.Python professionally, I find manual work required by the latter to be 100% worthwhile and usually necessary.

C++ and Python are not very similar, and the result of auto-binding them typically gives up a combination of fluency and performance.

A simple example of the former is a C++ algorithm which writes to an output iterator. In Python this might be expressed as a generator. But none of the auto-binding tools can do this transformation.

As for the latter--performance--I have seen 100x performance penalties in practice when the blind lead the bind. A good example is that in Python we have memoryview and the buffer protocol, but auto-binding tools take these no further than std::vector (if that). A C++ API which produces a large stream of numeric data just begs to be bound using the buffer protocol or perhaps even NumPy directly. But if a C++ API produces small values really quickly, an auto-bound one will produce the same small values really slowly.

Some people see the writing of bindings as manual labor to be avoided. I see it as an optimization opportunity. There are huge gains available.

jzwinck··on Automated snare drum made to the order of Aphex Twin (2014)
Really interesting writeup. The contraption has parallels to some of what we do with software: automating a legacy system without completely reinventing it.

For such an accomplished practitioner, the author made one glaring mistake:

> We will use one solenoid on each side of the snares, thus doubling the force

Clearly they have a system with one solenoid pulling from each end of the same thing. This does not increase the force at all. Pulling on a rope with one end fixed is just as good as pulling on both ends (from the rope's perspective there is no difference).

← PreviousPage 13 of 34Next →