Better HN
topnewbestaskshowjobs
Log inSign up

helldritch

185 karma · joined May 16, 2020 (6y ago) · 47 submissions

Submissions

comment 6y ago · link · parent

It's also worth mentioning that coming back isn't necessarily a fixed requirement. I would happily live a shorter live on Mars - with the risk overhead of being stranded in the event of a catastrophic failure - for the chance to be one of the first Martian settlers.

Foreign colonists in the Americas (ignoring any political aspect of this) faced disease, starvation and attacks from natives but still colonised America because of a dream they had.

comment 6y ago · link · parent

I'm curious how well this applies to the short-term effects of filling the Grand Ethiopian Renaissance Dam? [1]

As I understand it a lot of the downstream ecological effects rely entirely on the fill rate the Ethiopians choose (3 years, 5 years, 10 years, 15 years, etc). A fast fill rate (5 years or less) could have significant short to medium term effects on the arable land downstream in Sudan and especially Egypt.

The dam is oversized for its power output (to ensure it can meet peak output demands during the wet seasons) and will operate as a fish trap, cutting the number of fish able to head downstream (and ultimately to the sea / mouth of the Nile) by a significant amount.

[1] https://en.wikipedia.org/wiki/Grand_Ethiopian_Renaissance_Da...

comment 6y ago · link · parent

Not the OP, but one example (UK specific but guided by European law) is The health and safety (display screen equipment) regulations 1992, as amended by the health and safety (miscellaneous amendments) regulations 2002 [1]

Under the heading Requirements for Work Stations (Reg 3. and schedule):

24 Regulation 3 requires workstations to meet the requirements of the Schedule, (subject to the proviso outlined below), which sets out minimum requirements for the display screen, keyboard, desk, chair, work environment (including working space, lighting, reflection and glare, noise, heat and humidity), task requirements and software. Requirements are set out in fairly general terms, eg "The seat shall be adjustable in height". The Schedule does not contain technical detail.

Paragraph 32 states that anti-glare filters must be provided by workplaces which use DSE (display screen equipment) which are capable of projecting glare.

[1] https://www.hse.gov.uk/foi/internalops/ocs/200-299/oc202_1.h...

comment 6y ago · link · parent

I'm currently working on a progressive web application for support workers in care homes.

I've seen through first hand experience how much paperwork there is in this setting (daily outcome charts, medicine administration records, abnormal behaviour records, dietary and fluid intake, etc) and how many clerical errors there are. I've also seen first hand the key-document-dependency there can be around service user files, communication notification booklets for staff, etc, where changes often happen synchronously and are forgotten because the document isn't available in the moment.

I've spent the last 4 months or so taking a sabbatical from working as a software engineer to work for £9.00/hour at a support home for people with mental and physical disabilities (think Down's syndrome or people who are unable to live in an independent setting). As a result I now know an awful lot about this setting, the people who work in this industry, the minimum feature set I would need and the legislative landscape these companies operate in.

The best way to find a profitable side project is to become familiar with a none-technical discipline which is direly in need of modernisation. If you don't want to take time out of work, then choose an industry (it could be tree felling, red-brick manufacturing, shale oil extraction or solar panel installation) and figure out what the problems are plaguing the companies, staff or end customers.

There are so many $1,000,000,000 companies out there just waiting to be founded in areas which are considered unsexy and don't involve yet-another-to-do-list application. Find one company, with one problem, fix the problem, there's your profitable side gig.

comment 6y ago · link · parent

I've had discussions like this in the past, where people ask me "can we do it in 3 days instead of 5?" And I've found the easiest way to sell it to them is to ask which 40% of the feature set they would like me to remove from the deliverable?

comment 6y ago · link · parent

Also: Our issues with Laravel / Symfony weren't just performance, but also statefulness and memory leaks. Circular references, etc, which persist throughout multiple network requests. In a normal PHP flow using php-fpm or apache-php-cgi this isn't an issue: The PHP process is created, used and thrown away. For a Swoole setup, these memory leaks quickly get out of control and cause performance issues, instability and very occasionally superfluous garbage collection runs.

comment 6y ago · link · parent

It's part of a live video platform for a gaming company which needs extra information to be overlaid on top of their live stream (for the customer in-video frame performance is incredibly important: the stream run at 30fps (so a maximum of 33ms per frame) and the overlay information has to be generated in 11ms or less)

We did originally consider writing it in Rust (it would have been my personal preference) but the consensus was that since the rest of the tooling for this customer is in PHP we didn't want to add a skillset they didn't have internally if they were to move away from us in the future (we aren't big on needless vendor lock-in and prefer to compete on quality and service).

We experimented with PHP7.4 and Symfony / Laravel and found that we didn't have the performance leeway we needed, even with preloading / opcache.

We opted for Either Swoole or Phalcon, tried them both and found that Swoole was more to our liking and was somewhat more performant than Phalcon in our real-world testing.

We are exposing Swoole directly to them within their VPC, so we were able to do away with NGINX as a reverse proxy as well and have Swoole handle the HTTP request phase and HTTPS. We were able to make heavy use of Swoole\Table to save superfluous trips to Redis and run a Redis synchronisation process in a coroutine thread when the concurrent number of network tasks drops below 16.

Our end service response times (including network overhead) are around here:

- Mean response time: 4ms

- Fastest: 2ms

- 99th percentile: 9ms

- 999th permille: 10ms

One unforeseen side effect is that it has a crazy amount of scalability built in by default, the 8core machine the process runs on can easily scale up to 15,000 concurrent requests (as in 15,000 requests per second) without going over 15ms for response times, and can scale up to 45,000 concurrent requests before things start to "break".

comment 6y ago · link · parent

This has been my experience: In creating a Framework which follows the general principles of a Symfony application (since we're all familiar with Symfony) we've ended up with interfaces that closely mirror what we're used to in Symfony.

The end result has its own pros and cons:

* We don't get the brute-force security you get when millions of websites are running the same framework

* Our implementation is much faster (and there are many fewer memory leaks, as that was a core concern), as it only has the features we actually need.

* Without middleware layers for cross compatibility there are fewer abstractions, this allows the entire framework and application to be reasoned about with a lot less magic obfuscating the code which is actually running.

* If something is slow, it isn't an opaque problem of "symfony being slow", it's "@helldritch can you take a look at \App\Framework\DB\Query\JoinHydrationStrategy on line 112? If you unset the fields you no longer need, the hydration runs in linear time - much quicker when joining collections of Users against the Groups they're in)" <-- an actual message from our Discord.

* Each feature takes a little bit longer to develop (as the Framework needs the implementation before the application can use it)

comment 6y ago · link · parent

We did, we had a play with Swoole and Phalcon when we were in the RFC stage of our project.

We found Phalcon to be a bit too opinionated in how to do things, and we fell in love with how Swoole has implemented Coroutines and (practically) free context switching between long running asynchronous processes and short running network requests.

Looking back, I do actually wish we had chosen Phalcon (the documentation is a lot better than Swoole's, which is lacklustre to say the least, and occasionally intersperses random characters in Simplified Chinese halfway through sentences), but we've been happy with Swoole's Table implementation which allows us to share memory between network request Coroutines and hit the Redis cache a whole lot less.

comment 6y ago · link · parent

I agree with everything you've said, with the exception that it doesn't fit our usecase.

We run and maintain several Symfony applications, we're very familiar with frameworks, how they work, their strengths and weaknesses.

This was a carefully considered route:

We wanted to be writing PHP code with high performance and strict response time requirements, as such:

* Symfony was instantly ruled out.

* We knew we would struggle to do this with raw PHP but didn't want to retrain the team to learn a new language (our thinking being we would likely write something inferior and insecure).

* We considered Phalcon and Swoole and ultimately decided on Swoole as we found Phalcon a bit too opinionated. That being said, Swoole's documentation isn't great so we've had to internally document it. (We will probably push a few documentation PRs for swoole-src when we're done).

* We didn't trust a big framework to have zero memory leaks, which is a key issue for long running Swoole processes, since it's not a typical issue for the single-use PHP processes we are used to.

With regards to documentation, it's very well documented (with documentation explaining the reasoning behind each class, usage, pitfalls and how it fits in to the larger application, and documentation for the wider ergonomics of the application, debugging, performance considerations, etc), with a 96% test php-unit coverage for the Framework.

Your concerns are very well received and are concerns we have had from the beginning. Constant vigilance and a deep respect for my co-workers is what keeps this little project on the straight and narrow.

comment 6y ago · link · parent

I found it most useful to follow what people are already used to, which is to say that it follows the principles laid out by Symfony.

The code for the framework is its own composer library which is pulled in to the vendor directory, the code for the application sits within src/{BundleNamespace}.

If there's a service, it's a service, if there's a controller, it's in Controller, etc.

The aim is to maximise ergonomics and familiarity while minimising surprises. If a developer can pick up your microframework and be instantly writing code then you've done your job right.

comment 6y ago · link · parent

Yes! I haven't seen this before but it's incredibly similar to what I've ended up with.

There are some superficial differences (we don't have Twig as it's serving as an API, etc) but it mostly follows what the repository you posted lays out.

comment 6y ago · link · parent

Most people need to try a few antidepressants to find one which really works for them and which they can take with relatively few side effects.

I had Sertraline 150mg previously and found that rather than helping me it caused a significant increase in my suicidal ideation.

I now take Mirtazapine 45mg instead and the suicidal ideation has gone away entirely, of course I have other side effects (the Mirtazapine makes me drowsy and has caused me start snoring!)

If you're reading this and your not getting a good response from your current medication, talk to your GP about changing to something else. Sertraline didn't work for me, but very well could for you, etc.

comment 6y ago · link · parent

I agree with a lot of what this article says.

I've recently started a new application in PHP which has very strict time / performance requirements. I could build it in another language, but I'm most familiar with PHP, the thing would take me 4x as long to build in Rust.

The default frameworks (Laravel and Symfony) are very slow out of the box, and doctrine / propel are pretty slow as well.

I've instead built something entirely brand new using Swoole and an assembled set of very fast and very light Composer packages (namely Fastroute and PHP-DI) and everything else I'm building myself (compromising on reusability and full-featuredness in return for raw performance).

I've split the code in to two: one half is the framework, it's concerned with routing, dependency injection, models and hydration, event handling and responses. The other half is focussed on the business concerns: creating users, creating authentication token, performing searches.

There were a few challenges: moving from single row, single model queries to hydrating complex joined collections was a major multi-day challenge, but the end result is that when a request has all the data it needs cached, it responds in ~3ms, when it needs something from the database it responds in ~10ms.

I was apprehensive when I started, and a half decade ago this codebase would be an unmaintainable mess, but I'm finding it a joy to work in: there are few layers of abstraction, not a single line of code is wasted, and when something goes wrong there's no magic obfuscating the true problem.

comment 6y ago · link · parent

Interesting, in the UK Corona seems to be doing quite well, anecdotally I'm noticing it popping up as an extra option on a lot of food delivery restaurants, and a lot of friends posting pictures of their bottles after work.

Perhaps this is purely attributable to the British sense of irony.

comment 6y ago · link · parent

This reminds me of "identity theft".

Someone didn't steal my identity, someone stole from the bank using my identity. It should really be called "bank fraud".

comment 6y ago · link · parent

For those, like me, who don't know what the acronym LTO is: it's Link-time optimisation, the stage during compilation where the "linker" has all of the object files which make up your program available to it, and is therefor able to optimise across the entire program at once (instead of the individual constituent source files which make up the program).

There's a long, detailed PDF about LTO produced by GCC which was useful in helping me to understand exactly how this works here: https://gcc.gnu.org/projects/lto/lto.pdf

12