Hacker Newsnew | past | comments | ask | show | jobs | submit | ketanmaheshwari's commentslogin

I am personally interested in the code amalgamation technique that SQLite uses[0]. It seems like a free 5-10% performance improvement as is claimed by SQLite folks. Be nice if he addresses it some in one of the sessions.

[0] https://sqlite.org/amalgamation.html


This is a pretty standard topic, and not really a compiler optimization. It's usually called a unity build.

[0] https://en.wikipedia.org/wiki/Unity_build


Unity builds have been largely supplanted by LTO. They still have uses for build time improvements in one-off builds, as LTO on a non-incremental build is usually slower than the equivalent unity build.


At my company, we have not seen any performance benefits from LTO on a GCC cross-compiled Qt application.

GCC version: 11.3 target: Cortex-A9 Qt version: 5.15

I think we tested single core and quad core, also possibly a newer GCC version, but I'm not sure. Just wanted to add my two cents.


I would expect a little benefit from devirt (but maybe in-TU optimizations are getting that already?), but if a program is pessimized enough, LTO's improvements won't be measurable.

And programs full of pointer-chasing are quite pessimized; highly-OO code is a common example, which includes almost all GUIs, even in C++.


Do you link against a version of the Qt library that provides IR objects?

In any case even with whole program optimization, O would expect that effectively devirtualizing an heavily object oriented application to be very hard.


For those of you playing at home, LTO is link-time optimization.


Eating cardamom as I read this. My go to spice to keep mouth busy and flavorful and stay away from junk food.


Happy Thanksgiving everyone. What are your plans for the long weekend if you don't mind sharing.


Not the op but here is an example: TOKEN=$(kubectl describe secret -n kube-system $(kubectl get secrets -n kube-system | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t' | tr -d " ")

This pipeline may be significantly reduced by replacing cut's with awk, accommodating grep within awk and using awk's gsub in place of tr.


Example of replacing grep+cut with a single awk invokation:

    $ echo token:abc:def | grep -E ^token | cut -d: -f2
    abc
    
    $ echo token:abc:def | awk -F: '/^token/ { print $2 }'
    abc
Conditions don't have to be regular expressions. For example:

    $ echo $CSV
    foo:24
    bar:15
    baz:49
    
    $ echo $CSV | awk -F: '$2 > 20 { print $1 }'
    foo
    baz



After learning AWK I realised it could be used really neatly for problem 67. I remember it was blazing fast, orders of magnitude faster than Python


Did you use the regular version or the one with multiple-precision values?


I used the regular version. Actually, I don't even know what is multiple-precision values -- will look it up.


I am interested in quantitative / probabilistic analysis on your thesis. Where should I go look?


nice prompt


troll


Does anyone know how to reliably use Firefox from command line to take screenshots? It used to work well a few years ago but now it does not. For one, it asks that Firefox is already running and I need to kill it. This is surprising -- why can't two Firefox processes run at the same time?


It is whining about the shared use of your main profile directory. You can give it a temporary profile directory to more clearly express your intentions via "--profile=/tmp/$(uuidgen)" or similar. I'd guess you could even just straight up point <<env HOME=$(tmpdir) firefox --screenshot...>> for even stronger isolation


The CLI has long had `-noremote` for a long time to tell it you want a second Firefox. It's useful with `-ProfileManager` or `-P $profileName` for multi-profile workflows, which are out of fashion this decade, especially with Multi-Account Containers being able to do most of those workflows in the same browser window now with different tags. But some of us still have ancient profiles for ancient reasons and ingrained habits regarding them.

Ancient documentation: https://www-archive.mozilla.org/docs/command-line-args.html


  PROFILEDIR="$(mktemp -d)"
  firefox --no-remote  --profile "$PROFILEDIR" --screenshot $PWD/output.png https://xkcd.com
  rm -r "$PROFILEDIR"
(You don't have to create and destroy a profile directory every time, but it's cleaner to do that way and you need one per instance you're going to run anyways)


Script with Playwright?


Use playwright?


Is this true for the trained pilots as well?


It's next to impossible to know at night.

The only thing you have visually is direction / angular velocity.


And if you're on a collision course the other vehicle will appear motionless, with no change in direction.

If the airliners was approaching faster than the helicopter it could have been approaching from behind. How large is the field of view of a UH-60?


"How large is the field of view of a UH-60?"

Massive, you're practically against the glass. Visibility below is more obstructed than visibility above or to the sides.


From the radar tracking, they appear to have been at least somewhat head-on.

(Also at a low altitude in a large city ... lots of lights.)


I wonder if there's a support element that would have obstructed the field of view over a narrow angle. This has been the cause of automobile accidents when cars approach at just the correct speeds to keep the other vehicle behind the pillar at the side of the windshield.


Yes.



I have no skin in the game and rarely code in C++. My answer is: no.


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

Search: