Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Non-programming question about Java...

Non-programming question about Java...

Scheduled Pinned Locked Moved The Lounge
questioncsharpjavalearning
74 Posts 33 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    I wouldn't say "absolutely terrible", there's worse stuff out there.. but I still maintain that C# is "Java done right".

    S Offline
    S Offline
    ScottM1
    wrote on last edited by
    #27

    I don't think there is anything worse than Swing though.

    M 1 Reply Last reply
    0
    • Sander RosselS Sander Rossel

      So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

      It's an OO world.

      public class Naerling : Lazy<Person>{
      public void DoWork(){ throw new NotImplementedException(); }
      }

      M Offline
      M Offline
      Mark_Wallace
      wrote on last edited by
      #28

      Just beware of objectfuscation[^]

      I wanna be a eunuchs developer! Pass me a bread knife!

      Sander RosselS 1 Reply Last reply
      0
      • M Mark_Wallace

        Just beware of objectfuscation[^]

        I wanna be a eunuchs developer! Pass me a bread knife!

        Sander RosselS Offline
        Sander RosselS Offline
        Sander Rossel
        wrote on last edited by
        #29

        return IAnswer ;p

        It's an OO world.

        public class Naerling : Lazy<Person>{
        public void DoWork(){ throw new NotImplementedException(); }
        }

        1 Reply Last reply
        0
        • Sander RosselS Sander Rossel

          So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

          It's an OO world.

          public class Naerling : Lazy<Person>{
          public void DoWork(){ throw new NotImplementedException(); }
          }

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #30

          I used Java and eclipse a lot in my last job and got to like it; it did what was expected of it. As with all languages, hardware platforms and operating systems, there are pros and cons, lovers and haters, and, worst of all, bigots.

          One of these days I'm going to think of a really clever signature.

          1 Reply Last reply
          0
          • Sander RosselS Sander Rossel

            So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

            It's an OO world.

            public class Naerling : Lazy<Person>{
            public void DoWork(){ throw new NotImplementedException(); }
            }

            N Offline
            N Offline
            Nagy Vilmos
            wrote on last edited by
            #31

            I like Java. The 'big' thing that people often point out is the lack of properties. It takes a bit of getting used to but becomes second nature, everything, everything I say, is performed through a method. But it's just another language with advantages and disadvantages. If you know how to code, then it is as good, or as bad, as any other. If I need performance or low level control then I'd use C or C++, but for most jobs Java is just fine. Pick the right tool for the right job. Simples.


            Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

            1 Reply Last reply
            0
            • S ScottM1

              Based on what? I doubt that.

              W Offline
              W Offline
              wout de zeeuw
              wrote on last edited by
              #32

              There are large areas where .NET is just not very efficient, e.g. in passing around structs to methods. In theory it could be made efficient (like the java VM), but MS has shown little interest in doing so. Have a look here for some numeric performance measurements: http://www.itu.dk/people/sestoft/papers/numericperformance.pdf[^].

              Wout

              B 1 Reply Last reply
              0
              • W wout de zeeuw

                There are large areas where .NET is just not very efficient, e.g. in passing around structs to methods. In theory it could be made efficient (like the java VM), but MS has shown little interest in doing so. Have a look here for some numeric performance measurements: http://www.itu.dk/people/sestoft/papers/numericperformance.pdf[^].

                Wout

                B Offline
                B Offline
                BobJanova
                wrote on last edited by
                #33

                The only test that C# loses on in there, if you look at the MS JIT'd version not the Mono one (which is not a fair comparison with the commercial Sun JVM) is the matrix multiplication one and using double[,] is known to be a bad idea for performance.

                W 1 Reply Last reply
                0
                • Sander RosselS Sander Rossel

                  So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

                  It's an OO world.

                  public class Naerling : Lazy<Person>{
                  public void DoWork(){ throw new NotImplementedException(); }
                  }

                  B Offline
                  B Offline
                  BobJanova
                  wrote on last edited by
                  #34

                  It's not horrible. That's typical 'language war' overstatement. But it is just a bit worse than C# in pretty much every way (I really can't think of a single advantage now that Mono/Moonlight clears up most of the 'cross platform' thing that Java used to have over everyone else):

                  • No properties; code looks less tidy and you get 'paren fatigue' trying to read it
                  • LINQ is awesome
                  • Java's generics are a bad post-hoc hack that don't really work properly (for example you can't use T.class or have two method overloads which take different types of List)
                  • Package visibility is much less useful than internal in .Net
                  • csc directly produces a usable DLL/EXE; javac produces something you need a build tool to turn into something runnable
                  • lambdas and delegates
                  • proper events as a language feature
                  • Lots of minor things that make code nicer to read (typeof(T), is and as instead of instanceof, upper case convention etc)
                  • Much better UI libraries in the framework (AWT and Swing are notoriously awful; WinForms and WPF are both pretty good)
                  • Better thought out collections in the framework (see also Generics, above)

                  There's also the community, which isn't really the fault of the language, but Java is the source of most of the 'factory factory factory pattern' type of thinking.

                  J 1 Reply Last reply
                  0
                  • B BobJanova

                    The only test that C# loses on in there, if you look at the MS JIT'd version not the Mono one (which is not a fair comparison with the commercial Sun JVM) is the matrix multiplication one and using double[,] is known to be a bad idea for performance.

                    W Offline
                    W Offline
                    wout de zeeuw
                    wrote on last edited by
                    #35

                    Hmm, that's right, that was a rubbish reference! I ran accross articles about the jvm being quite fast several times though, but I never bothered to bookmark them, so can't find them quite quickly. .NET's passing around structs still sucks though.

                    Wout

                    S 1 Reply Last reply
                    0
                    • Sander RosselS Sander Rossel

                      So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

                      It's an OO world.

                      public class Naerling : Lazy<Person>{
                      public void DoWork(){ throw new NotImplementedException(); }
                      }

                      K Offline
                      K Offline
                      Kimberley Barrass
                      wrote on last edited by
                      #36

                      Personally speaking, I find it a fine and extensible language. Fairly elegant, and with MASSES of freely available code available means it is very easy to learn, and use to actually do something useful. BUT, outside of the language itself, I find it to be despicable to actually deploy and use in an enterprise environment. The tuning is dire, permgen growth is unacceptable, and I much, much prefer the .net framework. If it wasn't for the fact that it is the easiest way to program on posix based systems I probably wouldn't use it at all...

                      1 Reply Last reply
                      0
                      • W wout de zeeuw

                        Hmm, that's right, that was a rubbish reference! I ran accross articles about the jvm being quite fast several times though, but I never bothered to bookmark them, so can't find them quite quickly. .NET's passing around structs still sucks though.

                        Wout

                        S Offline
                        S Offline
                        ScottM1
                        wrote on last edited by
                        #37

                        I'm not sure I understand, how does it suck? Pass them using ref and it will be quick.

                        W 1 Reply Last reply
                        0
                        • Sander RosselS Sander Rossel

                          So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

                          It's an OO world.

                          public class Naerling : Lazy<Person>{
                          public void DoWork(){ throw new NotImplementedException(); }
                          }

                          E Offline
                          E Offline
                          englebart
                          wrote on last edited by
                          #38

                          Java is not horrible and the runtime has been very stable through all of the updates. You can probably take code compiled fifteen years ago by the 1.1 compiler and run it under the 1.7 runtime. Have fun with inner classes inside methods that automatically "clone" final stack variables from the containing method; one feature of Java that I wish C# would copy. The IDE should handle all of your imports for you. I have only had one time in the last fifteen years of working with Java where I really needed a pointer to help with some data structure manipulation. I managed to get something working but it was inefficient.

                          1 Reply Last reply
                          0
                          • S ScottM1

                            I'm not sure I understand, how does it suck? Pass them using ref and it will be quick.

                            W Offline
                            W Offline
                            wout de zeeuw
                            wrote on last edited by
                            #39

                            Some things are sub optimal, like mentioned a very long ago to MS here: https://connect.microsoft.com/VisualStudio/feedback/details/93858/struct-methods-should-be-inlined#tabs[^] Also see here for some comparisons between struct, passing by val/ref. Passing a struct by value has issues, as the CLR is not smart enough to handle that properly. http://www.kynosarges.de/StructPerformance.html[^] Also the java server VM seems to be better behaved in these tests. Passing a struct containing two doubles by value should be as fast as passing just a two separate doubles, but it's definitely slower (on x64 only at the moment presumably).

                            Wout

                            S 1 Reply Last reply
                            0
                            • Sander RosselS Sander Rossel

                              So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

                              It's an OO world.

                              public class Naerling : Lazy<Person>{
                              public void DoWork(){ throw new NotImplementedException(); }
                              }

                              S Offline
                              S Offline
                              Stingrae789
                              wrote on last edited by
                              #40

                              So I taught myself Java about a month ago after running through runtime hell for a week with my current project (where I have no 'real' need for C++). I have a semester's worth of experience with C# and my degree was primarily C++ with a splattering of other languages where appropriate. It took about a week to be comfortable in Java. I am now tutoring Java to first years, I ran into the flaws of JCreator which is a very familiar environment from a visual studio background but ultimately only the pro version is good enough when you compare against netbeans (my primary java ide) and eclipse. I have also found JGrasp adequate but not ideal due to the lack of intellisense (excuse the microsoft term). Netbeans window flexibility makes it my choice over eclipse although I still like the visual studio IDE. There are problems with Java but they aren't that noticeable for the most part. Language wars seem futile as compilers improve and cpu power available increases. The language design is however old, Scala is a more modern language for example and still works on the JDK. I also like the ability of Java to integrate with C through the JNI while not ideal, it provides potential optimizations. As for your queries: Properties are nice but certainly not necessary, import replaces using but I miss the idea of things belonging to namespaces (as done in C++ where std::vector != mycontainers::vector), while the ide resolves these I don't enjoy reading code where I can't tell what package things are from. I feel Java is better than C# because of greater portability however this doesn't mean C# doesn't have areas where it is better e.g. Unity3D and XNA are great C# based tools. Also I would like delegates as C# implements them in Java.

                              1 Reply Last reply
                              0
                              • W wout de zeeuw

                                Some things are sub optimal, like mentioned a very long ago to MS here: https://connect.microsoft.com/VisualStudio/feedback/details/93858/struct-methods-should-be-inlined#tabs[^] Also see here for some comparisons between struct, passing by val/ref. Passing a struct by value has issues, as the CLR is not smart enough to handle that properly. http://www.kynosarges.de/StructPerformance.html[^] Also the java server VM seems to be better behaved in these tests. Passing a struct containing two doubles by value should be as fast as passing just a two separate doubles, but it's definitely slower (on x64 only at the moment presumably).

                                Wout

                                S Offline
                                S Offline
                                ScottM1
                                wrote on last edited by
                                #41

                                Well then pass 2 Doubles, why create a struct for that? I just did this test on .Net 4 x64 where I made 10 million calls on 2 different methods, one that accepts a struct and one that accepts 2 Doubles. The one that accepts Doubles ran in 336 ms and the one that accepts a struct ran in 325 ms. It was consistently between 5 and 20 ms difference, hardly something to be concerned about.

                                W 1 Reply Last reply
                                0
                                • Sander RosselS Sander Rossel

                                  So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

                                  It's an OO world.

                                  public class Naerling : Lazy<Person>{
                                  public void DoWork(){ throw new NotImplementedException(); }
                                  }

                                  L Offline
                                  L Offline
                                  Lost User
                                  wrote on last edited by
                                  #42

                                  It depends on the point of view. When Java was introduced, it brought to production a lot of great ideas (including garbage collection). But, after 6 years of almost no evolution and the horrible handling of the Sun acquisition by Oracle, it's been left behind. The fact that there are a lot of legacy libraries not ready to use later language developments and the object-oriented dogmatism of the java community just add insult to injury. At a language (not platform) level, there is almost nothing java can do that c# cannot do, while there are plenty of things C# can do with much less code than java (think of dynamic types, lambdas and other functional programming consrtucts, implicit strong typing and all things that make for example ASP.NET MVC so wonderfull concise). In the end, most Java programs I've seen are very verbose. Some of the best professionals know when to use other languages based on the JVM (like groovy) to make coding more concise, but it's not a widespread practice. Java's slowly becoming the new COBOL.

                                  Sander RosselS J 2 Replies Last reply
                                  0
                                  • S ScottM1

                                    Well then pass 2 Doubles, why create a struct for that? I just did this test on .Net 4 x64 where I made 10 million calls on 2 different methods, one that accepts a struct and one that accepts 2 Doubles. The one that accepts Doubles ran in 336 ms and the one that accepts a struct ran in 325 ms. It was consistently between 5 and 20 ms difference, hardly something to be concerned about.

                                    W Offline
                                    W Offline
                                    wout de zeeuw
                                    wrote on last edited by
                                    #43

                                    Here's a test I just did:

                                        static void Main(string\[\] args) {
                                            int n = 10000000;
                                            for (int i = 0; i < 5; ++i) {
                                                TestStructPerformance(n);
                                                TestPrimitivePerformance(n);
                                            }
                                        }
                                    
                                        private static void TestStructPerformance(int n) {
                                            TestStruct s = new TestStruct();
                                            s.X = 1d;
                                            s.Y = 2d;
                                            s.Z = 3d;
                                            double x = 0d;
                                            DateTime start = DateTime.Now;
                                            for (int i = 0; i < n; ++i) {
                                                x += GetX(s);
                                            }
                                            DateTime end = DateTime.Now;
                                            Console.WriteLine("Struct elapsed time: " + (end - start).TotalMilliseconds);
                                            Console.WriteLine("(" + x + ")");
                                        }
                                    
                                        private static void TestPrimitivePerformance(int n) {
                                            double x = 1d;
                                            double y = 2d;
                                            double z = 3d;
                                            double t = 0d;
                                            DateTime start = DateTime.Now;
                                            for (int i = 0; i < n; ++i) {
                                                t += GetX(x, y, z);
                                            }
                                            DateTime end = DateTime.Now;
                                            Console.WriteLine("Primitive elapsed time: " + (end - start).TotalMilliseconds);
                                            Console.WriteLine("(" + t + ")");
                                        }
                                    
                                        public struct TestStruct {
                                            public double X, Y, Z;
                                        }
                                    
                                        public static double GetX(TestStruct s) {
                                            return s.X;
                                        }
                                    
                                        public static double GetX(double x, double y, double z) {
                                            return x;
                                        }
                                    

                                    Results on Intel CORE i5, x64, Win 7, .NET 4.0 (careful to run in release mode!): Struct elapsed time: 48,0061 (10000000) Primitive elapsed time: 32,5042 (10000000) Struct elapsed time: 52,5067 (10000000) Primitive elapsed time: 35,5045 (10000000) Struct elapsed time: 57,5073 (10000000) Primitive elapsed time: 32,004 (10000000) Struct elapsed time: 48,0061 (10000000) Primitive elapsed time: 32,0041 (10000000) Struct elapsed time: 44,5057 (10000000) Primitive elapsed time: 29,0037 (10000000) Our software often works with 2D, 3D and 4D vectors/points, and just passing the doubles as separate parameters would not be workable on the scale that we use it. In some performance critical bits we can do that, but the best thing if MS would fix these performance issues as it would be relatively minor effort for them to do so. EDIT: made minor screw up in the console output, just fixed that bit.

                                    Wout

                                    S 1 Reply Last reply
                                    0
                                    • L loctrice

                                      I started using jcreator. I didn't like it, and neither did anyone else in the class. We all had netbeans on a usb by the third week of class.

                                      If it moves, compile it

                                      O Offline
                                      O Offline
                                      onemorechance
                                      wrote on last edited by
                                      #44

                                      I started with a plain old text editor and command line. With that experience, I now appreciate a mature IDE (almost ... the text editor never hung & crashed). I have used NetBeans in the past, and am now using Eclipse, but those choices are mainly based on the client environment. Either one is a pretty solid improvement over a plain text editor ...

                                      1 Reply Last reply
                                      0
                                      • L Lost User

                                        It depends on the point of view. When Java was introduced, it brought to production a lot of great ideas (including garbage collection). But, after 6 years of almost no evolution and the horrible handling of the Sun acquisition by Oracle, it's been left behind. The fact that there are a lot of legacy libraries not ready to use later language developments and the object-oriented dogmatism of the java community just add insult to injury. At a language (not platform) level, there is almost nothing java can do that c# cannot do, while there are plenty of things C# can do with much less code than java (think of dynamic types, lambdas and other functional programming consrtucts, implicit strong typing and all things that make for example ASP.NET MVC so wonderfull concise). In the end, most Java programs I've seen are very verbose. Some of the best professionals know when to use other languages based on the JVM (like groovy) to make coding more concise, but it's not a widespread practice. Java's slowly becoming the new COBOL.

                                        Sander RosselS Offline
                                        Sander RosselS Offline
                                        Sander Rossel
                                        wrote on last edited by
                                        #45

                                        Yikes, that sounds bad... :~

                                        It's an OO world.

                                        public class Naerling : Lazy<Person>{
                                        public void DoWork(){ throw new NotImplementedException(); }
                                        }

                                        1 Reply Last reply
                                        0
                                        • W wout de zeeuw

                                          Here's a test I just did:

                                              static void Main(string\[\] args) {
                                                  int n = 10000000;
                                                  for (int i = 0; i < 5; ++i) {
                                                      TestStructPerformance(n);
                                                      TestPrimitivePerformance(n);
                                                  }
                                              }
                                          
                                              private static void TestStructPerformance(int n) {
                                                  TestStruct s = new TestStruct();
                                                  s.X = 1d;
                                                  s.Y = 2d;
                                                  s.Z = 3d;
                                                  double x = 0d;
                                                  DateTime start = DateTime.Now;
                                                  for (int i = 0; i < n; ++i) {
                                                      x += GetX(s);
                                                  }
                                                  DateTime end = DateTime.Now;
                                                  Console.WriteLine("Struct elapsed time: " + (end - start).TotalMilliseconds);
                                                  Console.WriteLine("(" + x + ")");
                                              }
                                          
                                              private static void TestPrimitivePerformance(int n) {
                                                  double x = 1d;
                                                  double y = 2d;
                                                  double z = 3d;
                                                  double t = 0d;
                                                  DateTime start = DateTime.Now;
                                                  for (int i = 0; i < n; ++i) {
                                                      t += GetX(x, y, z);
                                                  }
                                                  DateTime end = DateTime.Now;
                                                  Console.WriteLine("Primitive elapsed time: " + (end - start).TotalMilliseconds);
                                                  Console.WriteLine("(" + t + ")");
                                              }
                                          
                                              public struct TestStruct {
                                                  public double X, Y, Z;
                                              }
                                          
                                              public static double GetX(TestStruct s) {
                                                  return s.X;
                                              }
                                          
                                              public static double GetX(double x, double y, double z) {
                                                  return x;
                                              }
                                          

                                          Results on Intel CORE i5, x64, Win 7, .NET 4.0 (careful to run in release mode!): Struct elapsed time: 48,0061 (10000000) Primitive elapsed time: 32,5042 (10000000) Struct elapsed time: 52,5067 (10000000) Primitive elapsed time: 35,5045 (10000000) Struct elapsed time: 57,5073 (10000000) Primitive elapsed time: 32,004 (10000000) Struct elapsed time: 48,0061 (10000000) Primitive elapsed time: 32,0041 (10000000) Struct elapsed time: 44,5057 (10000000) Primitive elapsed time: 29,0037 (10000000) Our software often works with 2D, 3D and 4D vectors/points, and just passing the doubles as separate parameters would not be workable on the scale that we use it. In some performance critical bits we can do that, but the best thing if MS would fix these performance issues as it would be relatively minor effort for them to do so. EDIT: made minor screw up in the console output, just fixed that bit.

                                          Wout

                                          S Offline
                                          S Offline
                                          ScottM1
                                          wrote on last edited by
                                          #46

                                          I ran your code with the System.Timers.Stopwatch and I got the following on x64: Struct elapsed time: 84 (10000000) Primitive elapsed time: 66 (10000000) Struct elapsed time: 70 (10000000) Primitive elapsed time: 58 (10000000) Struct elapsed time: 69 (10000000) Primitive elapsed time: 59 (10000000) Struct elapsed time: 69 (10000000) Primitive elapsed time: 61 (10000000) Struct elapsed time: 70 (10000000) Primitive elapsed time: 58 (10000000) Interestingly, the differences are actually similar when run under x86 which is not supposed to have this problem.

                                          W 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups