Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • R relibc
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 34
    • Issues 34
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • redox-os
  • relibc
  • Merge requests
  • !167

Merged
Created Oct 07, 2018 by bfrascher@bfrascherContributor

Optimise `memcmp` for speed

  • Overview 7
  • Commits 2
  • Pipelines 2
  • Changes 1

I saw that in other parts of the string module iterations over usize were used to increase iteration speed. In this patch I apply the same logic to memcmp. With this change I measured a 7x speedup for memcmp on a ~1MB buffer (comparing two buffers with the same content) on my machine (i7-7500U), but I did not do any real world benchmarking for the change. The increase in speed comes with the tradeoff of both increased complexity and larger generated assembly code for the function.

I tested the correctness of the implementation by generating two randomly filled buffers and comparing the memcmp result of the old implementation against this new one.

I ran the tests and currently currently three of them fail:

  • netdb (fails to run)
  • stdio/rename (fails to verify)
  • unistd/pipe (fails to verify)

They do so though regardless of this change, so I don't think they are related.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feature/optimise-memcmp