Hacker News new | past | comments | ask | show | jobs | submit | forgottenpaswrd's comments login

Don't use assembly, period.

I can make things go more than 10 times faster in assembly. My main job is as manager/entrepreneur but I could read-write assembly as a result of my experience and I help-guide other people easily.

In the real world 10 times faster is nothing. You should spend the time understanding the problem in a mathematical way, and VERY IMPORTANT, documenting your work using images, text, voice and video.

This way you could make things go 100, 1000, 10000 times faster as most algorithms could be indexed, ordered in some way as to make it extremely fast, like doing log() operations instead of n squared or cubic or to the elevated to four or five(when you manage several dimensions like 3D with time or video analysis or medical tomography).

More important than that, 10 years from now it will continue working in new devices or OSs and will be something that supports the company instead of being a debt burden because the original developer is not here now(or you don't have the slightest idea of what you did so far away in the past and did not document).

The main problem is that people is not self aware that they forget things. And your brilliant idea that makes everything go 3 times faster is nuts if it makes everything way harder to understand, or if it could be forgotten even by you.


That's not good advice. Whether you need to use assembly depends on the particular situation at hand.

Here's a practical example: as a result of redesigning the algorithm to use fixed-point and implementing it in assembly, I got it to run 600x faster than the initial C version. Big O complexity was the same, the difference was in the constant factor. But the constant factor matters! In my case, it meant that you could get your computation done in half a day instead of a year.

Yes, it took me 3 weeks to get the algorithm implemented, instead of a single day, but even so — it was definitely worth it. And in many cases even a 3-fold improvement in speed is important, if you have long-running calculations.


That bit about fixed point is exremely interesting.. I found your blog post about the project you're (I think) referring to (http://jan.rychter.com/enblog/2009/12/4/x86-assembly-encount...), but it doesn't mention the fixed point part.

Not knowing too much about processor architecture, I don't understand how fixed point can be much faster, since floating point ops are implemented in hardware.. I presume you used integer operations on your fixed point values, but could you explain a bit why it ends up being much faster than floating point?


It all depends on how precise your fixed point values need to be. If you can squeeze them into 8 bits (I could), you can use SSE 128-bit registers to operate on 16 values at a time. It gets even better with AVX, although that wasn't available to me at the time.

So the speedup is not just from going to fixed point, but from managing to use the vector instructions.


> Don't use assembly, period.

That is just terrible advice.

You're probably right that in most cases you should not write assembly code to try to make some code run faster. However, it is a very valuable skill to know how to read assembly code and spot the inefficiencies.

For a low level hacker, it is a very valuable skill to be able to write and especially read assembler code. I need that skill regularly in my day job. And I would have not acquired that skill if I had not written some assembly code. And besides, writing assembly code is fun!

Sometimes you need that 10x speed improvement to be able to do what you need to. To get your game running smoothly or your video playback work. You need to know when and how to optimize for performance.


"A 10x speedup isn't cool. You know what's cool? A 1000x speedup."


> More important than that, 10 years from now it will continue working in new devices or OSs

They said that about x86... 20 years ago. I have applications written in Asm that still work on the latest CPUs today. The same binaries, not even needing recompilation, now run several orders of magnitude faster. I still see a lot of potential in extracting performance from x86 and although I hesitate slightly to make this prediction, I think it'll be the dominant architecture for at least 10 more years.


> I think it'll be the dominant architecture for at least 10 more years.

That needs to be qualified as "for desktops/servers" or similar. x86 haven't been the dominant architecture for at least a decade, if ever, in terms of units shipped. It's being outsold in number of units by ARM at a 10:1 ratio, and MIPS and PPC's are shipped in higher volume as well, or at least did as of a year or two ago. Possibly even 6502 and various micro-controllers, though getting numbers is harder.

Keep in mind how many CPU's are around you. Our servers have an ARM core per harddrive, and several of our RAID controllers have multiple PPC cores, for example. We have some servers with dozens of non-x86 CPUs per x86 CPU. Even some SD cards have ARM cores on them.

Now consider your car, microwave, washing machine, dish washer, tv, set-top box, phones, camera, music player, digital radio. A lot of stuff that was semi-mechanical or employed discrete logic a few years back now have CPUs that are ridiculous overkill, but used because they're so cheap there's no reason not to.

x86 is a diminishing niche if you look at electronics as a whole.


There are exceptions... things like color space conversions (though technically the last time I did that was in Cg) where that is about all you can get.


I wouldn't call it "investment money". Have you seen the graphs going down(tech bubble burst 2001 and 2008). I will call it "Money press printing money", or

"let's save those that make poor decisions in the past so they don't bankrupt" money,

"let's give this people free public money at 0% interest rates so they can lend to the public at high interest rates" money.

"privatizing the profit, making public the loses" money.

Those people had basically sh#t as assets, but the central banks bought their sh#t with good money so they do not collapse the economy. The bailouts mean the public is underwater now and revolutions are coming all around the planet.

The problems are not solved, those that make bad investments have been rewarded taking money from those that create wealth.

But everything has a limit, Japan is paying 56% of their taxes in debt payment and growing. China bubble is bursting soon.


Am I the only one that looking at what the kids are doing in the pictures consider it totally normal?

In Spain we used to do way more dangerous things than those.

And it was risky, one of our friends died in the river jumping over a slippery stone and hitting his neck with a stone while falling backwards. I have to say he was pretty nuts and was in constant danger everywhere.

Another friend is in wheelchair after jumping badly from a big 20 meters high rock to the Mediterranean sea. We all jumped the rock. It was funny, but you need to know what you are doing.

But those are two cases over hundreds of people I knew well over my life.

We learned to do bunny hops and do jumps and go downhill. Skiing over rocks outside official circuit.

You leaned early on how to manage risks and how to say no when your friends want you into doing stupid things(or you are not skilled enough for the task). I really appreciate those memories(and continue doing risky things like BASE jumping).

I have to say that my friends doing risky things now that we are adults never had significant problems. They became experts managing risk and some of them even teach it.

So in my opinion total freedom has its drawbacks and is not a pie in the Sky, but it is worth it.


Yeah, times have changed.

I went to school in the UK, Germany, Hong Kong, Chicago - mostly boarding school in the UK.

When I was a kid (5-13), our principal form of entertainment was "go outside, do whatever". This usually entailed building fortresses out of junk, which usually involved deep excavations, traps that could actually kill (sash weights suspended in a tree, with tripwires, anyone?), and construction high up fir trees with "found" supplies. We used to go boating (on this neat lake full of totally lethal floating islands of rotted vegetation), unattended, and nobody thought anything of us taking a pile of unexploded mortars from the school fireworks show and sticking them in a bonfire. 7 year olds. Smart enough to know to run like hell and lie behind a dip in the land.

People got hurt all the time, with everything from broken bones to cuts and grazes to the occasional airgun pellet in an unfortunate place. The school matron was a very busy woman.

Once a year, the school had an organised "paddock war", in which everyone would arm themselves with whatever they could lay their hands on (cricket bats, improvised clubs, slingshots, etc.), and go beat each other senseless. Not sure this is quite the same picture, but it was a very effective way to get the pent-up aggression of 250 7-13 year old boys out in a single sitting, and not something that would happen today.

The headmaster, an old submarine captain, used to take a group of the older (10+) boys out on a ramble into the woods, always to a new spot, and would then just either leave us there, with our task being to get all of us back unscathed, or play hunter-killer games. Retrospectively I have a feeling he was actually sneaking off to have a drink in the woods, but it was a great experience.

Every single person with whom I played at that school is an entrepreneur. Every single one takes risks, wins, loses, and while their weltanschauungs vary hugely, from liberal to authoritarian to conservative to socialist, there's a common thread of willingness to try anything - that anything can be done - so long as one is willing to attempt it.

The same school is now co-ed (no bad thing, but has been used as the "reason" for change) and has done away with the outdoor play, having replaced it with a sterile, monitored, playground.

And we wonder why people are increasingly sheltered and closeted, with increasingly small worlds, with increasingly small sets of symbols with which to associate, and increasingly small ranges of thought.

We took away childhood and replaced it with a life of infantilism.


"Every single person with whom I played at that school is an entrepreneur. "

That one is more about you and your selection of friends. Your whole generation is not composed of entrepreneurs although they all played freely.


To a degree, true, although what wasn't clear from the above, admittedly, was that I'm a child of the 80's. I was fortunate to go to a school during those precious formative years in the late 80's/early 90's which refused to comply with the growing culture of pandering to parents' irrational media-driven fears. I didn't select my classmates!

Most of my generation did not play freely. I would go home from school holidays and attempt to muster neighbours/random local kids/friends into going for an explore/insane expedition into the local wasteland/abandoned buildings/woods/caves/whatever. Very few takers, and my mother got no end of "your child is a ne'er-do-well trying to lead my Johnny astray".


https://en.wikipedia.org/wiki/R/K_selection_theory

Humans are moving even stronger toward the K. People used to have many more children than they do now, and infant mortality was worse.

On top of that (for the child) taking a risk was worth it - if you didn't do really well, you did really badly.

These days things are more "even", a basic level of survival can be had easily, there is no reason to take big risks. The rewards for risk taking are more in terms of luxury than basic life.


I recall climbing up our 2 story middle school's roof to look for tennis balls that we accidentally hit up there. I can't imagine that happening today. Same with climbing up our house's drain pipe to let ourselves in the 2nd floor window. And the list keeps growing.


I love the memory of 'recalling' balls. Mainly footballs. Terraced by terraced houses, it was not unusual to scale a 10 foot brick wall (leg-up from friends) - getting back was the hard part.

Exiting the school gates to walk up the road (because the particular wall was unscalable, or there were dogs) was uncomfortable: "Ding-dong [at the front door of the neighbouring house]. Please Sir, may we have our ball back?" where a usually polite person would visit their back garden to return a football'.

And climbing on the roof of a Victorian structure where sand-brick was weathered sufficiently over a century of school children climbing up it to provide nice pockets and footholds.

Is this seriously not the case today? I'm only in my 30s...


Not the main problem by far.

I had backed hundreds of projects. Next year I would make a thousand or so.

How many scams I got into? Zero.

It is pretty easy to spot who is serious and who is not, who will deliver and who wont. The great thing about capitalism is being left to carry the risk yourself.


> The great thing about capitalism is being left to carry the risk yourself.

When it comes to equity investments, and not Kickstarter-like donations, the type of disclosures that the SEC is going to require are in line with what any serious investor would want even if they weren't required. Managing risk (which is not the process of asking your gut for its opinion) requires some level of transparency.

Obviously, many investors are not sophisticated or diligent, so they won't even review the disclosures available to them, but you also have to look at equity crowdfunding from the perspective of the people raising capital. Disclosure provides them with desirable protections too. The last thing any founder needs is several hundred ignorant and/or lazy shareholders who are going to be calling up an attorney when their $1,000 investment doesn't produce the expected return, even if the expected return was completely unrealistic.

Bottom line: this notion that markets don't demand some level of disclosure and transparency without regulation is silly.


Well, one of the reasons we hear a lot about VR, like 3d printing is that key patents have expired.

What are they going to patent?

Having a gyroscope in your head? A screen attached to your eyes? low persistence screens(valve idea)?


It is creepy to have a company know:

Your sexual habits. Haw many partners you have , how, where, when you have sex with them. Facebook and google log your mobile phone GPS coords.

Your political views.

What your friends thing about you better than you do(They control and store all of their private communications, including phone calls with Skype or Whasapp).

All your family and friends experiences and meetings.

Then they store this info and give it to the powerful companies and governments on demand, like we know via Snowden . For me it is creepy as hell.


I don't disagree at all.

If Facebook puts itself to be in this position without possibility of opting out, that is what I hope would trigger people to seek an ethical competitor. And, similarly, that is what I hope would occur to them would be for consumers in aggregate to be an intolerable consequence of forcing on their customers Facebook's ability (and anybody's who could subpoena Facebook) to be privy to this sort of personal information.

I won't buy one of these if it can't be operated without a phone home. I don't mind sacrificing a bit of resolution or refresh rate with a competitor if the alternative is what you say. My hope is that Facebook recognizes that there is a significant market share they'd miss out on if they pushed that point... and, more importantly, that there would actually be a significant market share that they'd miss out on if they pushed that point.


I agree with your analysis.

In my opinion, everything that facebook says is true, today, but could be different tomorrow.

Like a marriage, when you are young and life is good is very different from when you get older, and life gets tough.

Today facebook is incredible rich because they convinced millions of people to buy shares of the company. They promised a good return from their investment.

Being rich they could buy Whassapp, Instagram and respect them like in when you are in love everything is seen with rose colored glasses.

Now, when investors get nervous because facebook profit does not grow enough, their market sinks, the Federal Reserve stops pumping the stock market, or the good people inside starts cashing out their money and leaving.... then suddenly life becomes different.


Congrats!, great work.

This has lots of useful applications. E.g Do you know those graphics about a submarine of the WW2, or a Spanish galleon in which you could see what is inside, like in the book "incredible cross sections"?

With your tech you could make this but dynamic and alive!! peering what you are interested in. While most of the scene is static, you could move some things a little and make it alive.

You should contact one of those amazing artist and show them what you have. There is no way they would resist an offer of working on something like this.


I have a copy of Stephen Biesty's castle cross-section book sitting on my desk. He provides great reference material. :)


That is "just a choice of style" and you can do it without voxels just fine (with some boolean subtraction if you are lazy). I love that style too!


Man, first thing: YOU ARE NOT ALONE.

You are not the first human to become addicted, nor will be the only one. There are people out there that have been in a worse situation than you and that have gone out of addictions.

You should find those people, meet them and get out of drinking. Over years you made a path that you have to undo. This will take years, like it took you to create it.

Your wife and kids did the right thing: to stop supporting your addiction. It is time for you to take steps.

I have studied a lot of psychology but I can't help you because it would be like trying to explain quantum physics before learning basic math. But there is people out there that really know what steps you could take for getting out and doing great things with your life.


>You should find those people, meet them and get out of drinking

I don't mean to be offensive but...

This can work, however it might not work depending on who you find. Many former addicts I personally know have replaced their drug habit with a religion habit. They are actively preaching religion at almost all times. This is probably due to the twelve step programs. If you aren't into religion or being preached at, you could be turned off by hanging around these people and thinking that's how your become if you quit, or you need religion to keep you from drinking.

I just know an addict, he avoids getting help because he believes that the 12 step programs are offensive. (I share the same opinion - however I acknowledge they work for some people and that's good - I just disagree they should be the "go to" programs for everyone) He knows AA doesn't work for him, but he doesn't know there are non-religious programs and people who have gotten better without religion.

Disclaimer: The following post is entirely my own experience. It might not reflect everyone's experience. It may or may not be useful. I am just an atheist who knows many former addicts. I have read the AA "big book" some, and I couldn't stand how they treated non-believers. They basically said non-believers can't get better without accepting the Judeo-Christian God. It quotes the bible excessively. Anyone who says AA isn't a religious organization is being dishonest or very selective.


Agreed. AA is a religious program, and if you're not religious you shouldn't do it. It's also not backed by sound medical research, and about 50% of people drop out after the first 90 days.

What is effective about twelve step programs is the support network you build. It's important to have friends you can call on when you're thinking of going to the bar, or just want to take a walk or try something new.


> "It quotes the bible excessively"

Absolutely false. I can't locate a single instance. Care to provide some page numbers?


I admit, it has been a while since I read it and that is what I remember. I went back and reread some of it, and you are right I couldn't find any direct quotes. That was my mistake.

It does however have its roots in The Oxford Group.

You may find this of interest though:

http://healthland.time.com/2010/09/23/how-religion-was-edite...


I'm not an alcoholic, but it's great to see support like this. Cheers.


"who have no idea how to run a multi-million-dollar business, can turn on a dime and start slinging vitriol at the person they claimed to idolize just a day earlier."

As someone who does run a multi million dollar business and that supported the Oculus Rift buying ten of those in a kickstarter I would tell you something:

Nobody idolized Mr Palmer, they loved the vision, not the man. The vision is way more important than the person.

Specially when they asked for your support, and you support them, and then they change their vision, you have the right to complain, like I do.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: