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

Yeah performance counters

To fill in the details, here is the code used for the measurement:

https://github.com/lemire/counters/blob/main/include/counter...

It fetches the number of mispredicted instructions from Linux's perf subsystem, which in turn gathers the metrics from CPU's PMU (Performance Monitoring Unit) interface.


I like the coins idea. I don't subscribe because I know I'll forget about it and it will turn into a recurring charge on my credit card. But I would buy $10 of coins, knowing the paywall just comes back if I don't buy more, and if I lose interest it won't keep costing me anything.

When I see the "$1 introductory offer" I just think they are trying to trick me.


$13/month is less than many of those sites cost individually, but I get them all for that price?


A lot of it went into V8 too.


Larry should be remembered for the development of "patch" more than perl. Without the concept of fuzzily applying patches to modified source files you can't have "git rebase" or "git merge".


The syntax problems are just surface. There are some real problems underneath:

Poor performance of the single implementation.

A single implementation.

Leaky ref counted GC, but 'luckily' the syntax for references is so clunky that nobody does anything complicated enough that it really matters.

Bolted on object oriented features that never got the love they needed at a time when oo languages were sweeping the world.

Most of the wizards decamping to a new language (Perl6) that was 'developed' for years without an actual implementation to keep them grounded.


> 'luckily' the syntax for references is so clunky that nobody does anything complicated enough that it really matters.

That made me laugh. Unlike actually working with Perl references, which made me want to cry.


Strange, for me it's the opposite.

Just yesterday, I moved some 100 lines of code using a hash quite a few times from the main module to a function using a reference to the hash.

if %args is the hash holding the data, '$args{key}' tells me the value of 'key' in the main module.

a reference to the hash passed to the function is noted like so : '$args = \%args';$args->{key} tells me value of 'key'

All I had to do to adapt the code was to replace '$args{' with '$args->{', done by the time I typed the replace command in my editor.

Funny that it just makes sense to me, must be something with the brain's wiring.


Nice!

Why malloc? Surely this is an on-heap object, not malloc allocated?


I think you've got yourself confused. The heap is what malloc is allocating. So it's like you said "Surely this is somewhere in Europe, not France?" or "Surely this is a round shape, not a circle?"


Not when we’re talking about a JVM, which has its own heap that does not use malloc.


The JVM is of course just software. In this case it's mostly software written in C++ and that software allocates "its own heap" using uh... malloc

https://github.com/openjdk/jdk/blob/master/src/hotspot/share...


In the specific case of the OpenJDK, there isn't the one JVM, rather a standard[0], like in ISO languages, with a reference implementation to go along it,

https://en.wikipedia.org/wiki/List_of_Java_virtual_machines

And the list doesn't include all, e.g. PTC (https://www.ptc.com/en/products/developer-tools/perc)

[0] - https://docs.oracle.com/javase/specs/index.html


malloc is also not a specific implementation, but a standardized interface for allocating on the heap.


I'm actually pretty surprised if the JVM uses malloc to allocate the heap. V8 uses mmap, never malloc.


Yeah if you ever wondered why the fields in a lot of Posix APIs have names with prefixes like tm_sec and tm_usec it's because of this misfeature of early C.


You could always manually build the same thing as lambda with a class and you had the same problem.


The C++ GC is not for V8 code, it's for the users of the V8 API eg. Chrome (Blink). It's not being used for big internal systems like the compilers or GC.

V8 has its first module in Rust and I'm sure more are coming, but it's not necessarily an easy integration.

JS is a GCed language. Are there good examples of Rust interacting well with a GCed language runtime where it is able to free unreachable cross domain pointer cycles? Like a JS object that has a reference to a Rust object, which itself has a reference to a JS object. Add more steps and hopefully you can see that collecting such cycles is a hard problem. This is the problem the C++ GC solves.

By the way you can't always break cycles with weak pointers. The browser standards have semantics you have to adhere to.


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

Search: