|
|
Subscribe / Log in / New account

Amdahl's law, 55 years later

Amdahl's law, 55 years later

Posted Nov 1, 2025 7:27 UTC (Sat) by epa (subscriber, #39769)
In reply to: Amdahl's law, 55 years later by WolfWings
Parent article: Ubuntu introduces architecture variants

Adding escape backslashes to a string… it would take a diabolically cunning compiler to vectorize that code. Or should we write assembly language for it? Is there a better, more expressive language than C that can be compiled to efficient vector code, yet is safer than assembly language?


to post comments

An example of vectorisation helping string operation

Posted Nov 1, 2025 16:53 UTC (Sat) by fishface60 (subscriber, #88700) [Link]

I misremembered reading https://purplesyringa.moe/blog/i-sped-up-serde-json-strin... as doing manual vectorisation because it does some similar tricks within 32-bit registers, so it's not relevant for specifically how to do it, but may be of interest for how vectorisation speeds up string encoding and decoding.

Amdahl's law, 55 years later

Posted Nov 1, 2025 22:16 UTC (Sat) by WolfWings (subscriber, #56790) [Link]

This is where the 'intrinsic' pseudo-functions that Intel created for compilers greatly simplifies the code so you don't need to break out raw assembly and can let the compiler still deal with register usage and inter-mix its code with yours.

https://www.intel.com/content/www/us/en/docs/intrinsics-g...

For a simple but sufficient example of the escaping-strings idea, and how you can POPCNT the mask used for VPCOMPRESS to get the byte-count written https://lemire.me/blog/2022/09/14/escaping-strings-faster... is a pretty decent point of reference.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds