Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
aports
aports
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 643
    • Issues 643
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 166
    • Merge Requests 166
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • alpine
  • aportsaports
  • Issues
  • #11128

Closed
Open
Opened Jan 12, 2020 by Pavel Demin@pavel-demin
  • Report abuse
  • New issue
Report abuse New issue

gcc: memcpy on armv7 is much slower than on armhf

I recently switched from armhf to armv7 and noticed that memcpy on armv7 is much slower than on armhf.

Here is a simple test:

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 131072

int main()
{
  int i;
  clock_t time[2];
  void *src = malloc(N);
  void *dst = malloc(N);

  time[0] = clock();
  for(i = 0; i < N; ++i)
  {
    memcpy(dst, src, N);
  }
  time[1] = clock();

  printf("time: %ld\n", time[1] - time[0]);

  return 0;
}

and the results:

armhf:~# time ./test
time: 7310658
real    0m 7.31s
user    0m 7.31s
sys     0m 0.00s
armv7:~# time ./test
time: 12973756
real    0m 12.97s
user    0m 12.97s
sys     0m 0.00s

I suspect the source of the problem is the --with-mode=thumb flag on line 235 in gcc/APKBUILD.

Would it be possible to replace --with-mode=thumb with --with-mode=arm?

Edited Jan 12, 2020 by Pavel Demin
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: alpine/aports#11128