News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Quora rants about Assembly being slow

Started by jj2007, March 16, 2022, 11:08:38 PM

Previous topic - Next topic

jj2007

https://www.quora.com/Are-assembly-language-programs-generally-faster/answer/Christopher-F-Clark-1

daydreamer

well you cant take old 1980s asm code that was aimed at old 1980s cpu,which is more shifts prefered over muls and run it on P4,and probably compiler makers are skilled in cycle timings
asm programmers keep on update on whats fastest read intel manuals and time things,not stay still in old dos days
well <insert favourite language here> programmer also can use SIMT skills to make program faster
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--

JJ,

A rant about how sloppy software maintainance is, in some places.  :tongue:

Real Programmers[tm] rewrite the phukups and make them go faster.

jj2007

I can't post on Quora, otherwise I would have written that we are not happy if we can't beat C code by at least a factor 2 :badgrin:

jj2007

Mark Gritter:
QuoteSince programming languages use the time to seed a random number generator, does that mean that if you have two computers with the exact same processing speed, if you run the program at the same time, it would generate the same random number?

It's not the case that all programming languages or environments use the time to seed their RNG. The Linux kernel uses multiple sources of entropy.

However, the sort of failure that you're talking about does occur in practice! Researchers looked at network-connected devices that had generated their own private keys. Because many devices generate these keys when first booted, they do not have a good source of entropy. (Not even, potentially, the clock time!) As a result, they end up generating the same "random" number:

        We found that 5.57% of TLS hosts and 9.60% of SSH hosts share public keys in an apparently vulnerable manner, due to either insufficient randomness during key generation or device default keys.

Quick test:
include \masm32\include\masm32rt.inc
.686p
.code
start:
  xor ebx, ebx
  .Repeat
invoke Sleep, 0 ; no delay (worst case...)
rdtsc
and eax, 07FFFFFh ; let's filter out the highest bits
print str$(eax), 13, 10
inc ebx
  .Until ebx>=20
  inkey " "
  exit
end start


Wow, these numbers do all look so similar, don't they? :biggrin:
3574808
5267331
64049
3339218
6592167
1319335
4987200
8239896
3459054
248443
4251841
7828628
4561470
8083411
2827791
6274252
1305561
4920057
606864
3799456