Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8873739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:32:25+00:00 2026-06-14T18:32:25+00:00

The OpenTK libraries, and with them, MonoTouch and MonoDroid, contain the method LengthFast ,

  • 0

The OpenTK libraries, and with them, MonoTouch and MonoDroid, contain the method LengthFast, which should calculate an approximation of a vector’s length without the use of Math.Sqrt (which seems to be known as slow). LengthFast uses MathHelper.InverseSqrtFast, a quite interesting method which should give a fast approximation of the square root (see lines 172 and 196 of http://www.opentk.com/files/doc/_math_helper_8cs_source.html).

I created a small benchmark which invokes both calculations 100'000'000 times, with vector lengths between about 1 and 100.

On Windows 7 / Intel i7-2600 3.40 GHz, I got:

Length: 2947 ms

LengthFast: 4754 ms

On an iPad 3 with MonoTouch, I got:

Length: 51575 ms

LengthFast: 41252 ms

So, LengthFast is much slower on the Intel CPU, on the iPad’s ARM it is slightly faster.

Any explanation for this? Is that the result of the Intel CPU being able to calculate the square root ‘natively’ (without the use of software approximation)? Shouldn’t LengthFast be always faster, at least a little bit?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:32:26+00:00Added an answer on June 14, 2026 at 6:32 pm

    All Math members are really fast. Don’t try to speed up .NET math code. On a ARM processor it may be faster because there are some missing X86/X86_64 commands which are required for the same implementation on a ARM processor, so the code is different.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a MonoTouch-specific question. I'm currently developing a wrapper for OpenGL which is
Is anybody aware of a possibility to use C# libraries like OpenTK (http://www.opentk.com/) from
Today I learned that one of the .NET libraries I use, OpenTK, requires me
I'm looking for an example of loading a png-file on MonoDroid using OpenTK. Anyone?
I'm not 100% sure if the problem is with openTK but it is the
i am using C# (visual studio 2008) to develop a slot machine, using OpenTK
The bottom right image should have a transparent background. I load my Notch's PNG
I am new to opengl and using C#, opentk for development. My Application is
Imagine a cross-platform library that has to create its own windows without relying on
I'm using OpenTK OpenGL wrapper. Since it loads OpenGL dll (or .so on Linux)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.