Author Topic: Quora rants about Assembly being slow  (Read 834 times)


daydreamer

  • Member
  • *****
  • Posts: 2196
  • my kind of REAL10 Blonde
Re: Quora rants about Assembly being slow
« Reply #1 on: March 21, 2022, 10:28:50 PM »
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
http://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."

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10005
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Quora rants about Assembly being slow
« Reply #2 on: March 21, 2022, 10:42:01 PM »
JJ,

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

Real Programmers[tm] rewrite the phukups and make them go faster.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 13299
  • Assembly is fun ;-)
    • MasmBasic
Re: Quora rants about Assembly being slow
« Reply #3 on: March 22, 2022, 03:02:07 AM »
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

  • Member
  • *****
  • Posts: 13299
  • Assembly is fun ;-)
    • MasmBasic
Quora b*s*t about random number seeds
« Reply #4 on: May 15, 2022, 09:04:50 PM »
Mark Gritter:
Quote
Since 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:
Code: [Select]
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:
Code: [Select]
3574808
5267331
64049
3339218
6592167
1319335
4987200
8239896
3459054
248443
4251841
7828628
4561470
8083411
2827791
6274252
1305561
4920057
606864
3799456