Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
¿Cómo puede ser más rápido agregar una variable que agregar una constante?

Cambiar t=t+j (variable de bucle exterior) a t=t+9 dentro de dos bucles anidados aumentó el tiempo de ejecución en más del 10 %. ¿Cómo puede ser esto posible?

 for(int j=-1048576;j<1048576;j+=2000) for(int i=-1048576;i<1048576;i++) t+=9;//t+=j

Procesador: Celeron N3350

Miro el ensamblaje de ambos binarios. La única diferencia que noto:

 t=t+9 : addl $9, -4(%rbp) t=t+j : movl -8(%rbp), %eax addl %eax, -4(%rbp)
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!