tag:blogger.com,1999:blog-203063759820106893.post2242048895043945677..comments2023-03-25T08:30:26.602-04:00Comments on A Moment of Zen: Wouldn't it be nice if...Jeffrey Stedfasthttp://www.blogger.com/profile/12271561115384429651noreply@blogger.comBlogger43125tag:blogger.com,1999:blog-203063759820106893.post-2082458016473931172008-05-19T20:38:00.000-04:002008-05-19T20:38:00.000-04:00fwiw, it might be interesting for those claiming C...fwiw, it might be interesting for those claiming C# can't match C performance for parsing and I/O to read my Debian Language Shootout post on SumFile which has a C# implementation where even a highly optimized C implementation can barely outperform (and if I bothered to use pointers in C#, could probably match it).<BR/><BR/>An IMAP backend for Evolution would be 90% parsing input and writing output to a socket, so if I/O performance can match C and if the programmer used byte arrays instead of converting input buffers to char arrays (which would likely also incur charset conversion overhead, or at the very least an O(n) byte-to-char conversion), then there's no reason a C# backend couldn't have comparable performance to one in C.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-90974181312641059472008-05-15T12:20:00.000-04:002008-05-15T12:20:00.000-04:00...not to mention more scalable....not to mention more scalable.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-10979636138381131392008-05-15T08:22:00.000-04:002008-05-15T08:22:00.000-04:00np273:I never said that an IMAP implementation in ...np273:<BR/><BR/>I never said that an IMAP implementation in C# wouldn't use more memory than one in C.<BR/><BR/>Please reread what I said and then read your own response to what I said and notice that your response doesn't at all rebut what I had said.<BR/><BR/>However...<BR/><BR/>- Tomboy's startup time is irrelevant to the discussion.<BR/><BR/>- IMAP is not something that needs to be super memory efficient, using an extra meg or two isn't going to make a damn bit of difference on the desktop. It's worth the extra meg or two in order to have code that is far more maintainable and easier to write in the first place.<BR/><BR/>Should you later discover a performance critical section of the managed code, you could always go back and replace it with a P/Invoke into some native code.<BR/><BR/>I don't see this being an issue with IMAP, though, nothing is particularly time critical where shaving off a few microseconds somewhere is really going to make a difference.<BR/><BR/>Allow me to let you in on a little secret involving the current IMAP backend in Evolution.<BR/><BR/>The big performance suckage in the current IMAP backend has little to do with it not having optimized routines and everything to do with the design being poor... YET most people are happy with the performance so long as they don't have hundreds of folders with thousands of messages in each.<BR/><BR/>- The current IMAP code makes very expensive IMAP queries more than it needs to.<BR/><BR/>- There is a different parser for each command, all of which load the entire server response into memory before parsing.<BR/><BR/>A proper implementation (in C or C#) would be designed to avoid these issues, and, whether it being in C or C#, would likely use less memory than the current implementation and at the same time most assuredly be faster.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-2088324073232599342008-05-15T07:07:00.000-04:002008-05-15T07:07:00.000-04:00Jeffrey: insulting people is not going to make you...Jeffrey: insulting people is not going to make your point.<BR/><BR/>Tomboy takes 10 seconds to start up and needs ~30 MB to load a score of notes. Evolution takes 2 seconds to startup and needs ~130 MB to load about 20000 emails.<BR/><BR/>I have looked closely at Tomboy’s code. I know it’s not badly designed. But this is what happens with high-level languages. They are not bad per se, but they are slow and take memory. This is also true for python, and even knowing that I use python a lot. But I would NEVER use it for something that needs to be memory-efficient and close to the network protocol. <BR/><BR/>Mono plugins for Evolution? I cool with the idea. Making the core of Evolution use Mono for its most intensive tasks? Come on.<BR/><BR/>I know it can be hard to understand that your favorite operating system/programming language/text editor/desktop environment is not the best at everything, but it is a lesson that everyone needs to learn at some point.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-52189388653194597222008-05-13T15:54:00.000-04:002008-05-13T15:54:00.000-04:00...And a properly designed assembly implementation......And a properly designed assembly implementation could outperform a properly designed C implementation.<BR/><BR/>What's your point?<BR/><BR/>Unless the performance is noticeable to the person using it, it's not an issue.<BR/><BR/>If writing it in C# means it gets implemented faster, more robustly, and is more easily maintainable than a C version, then why <I>not</I> a C# implementation?<BR/><BR/>People have been getting along fine for 7+ years with the current IMAP implementation, so if a C# one comes along that is just as fast and yet more featureful, implements IDLE, etc then why not?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-75048962133404688912008-05-13T14:08:00.000-04:002008-05-13T14:08:00.000-04:00If it outperforms the current C backend, then it's...If it outperforms the current C backend, then it's still a win - no matter what language it's written in ;)Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-2941568730519376162008-05-13T13:50:00.000-04:002008-05-13T13:50:00.000-04:00"I'll wager that a C# backend, if properly designe..."I'll wager that a C# backend, <STRONG>if properly designed</STRONG>, could outperform the current IMAP backend that is written in C and have more functionality."<BR/><BR/>Emphasis mine. The issue here is with the design, not the programming language. With a better design, I'd say the C backend could outperform a better-designed C# backend.Philiphttps://www.blogger.com/profile/06614594496918845905noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-80318451897605223722008-05-13T13:22:00.000-04:002008-05-13T13:22:00.000-04:00I'll wager that a C# backend, if properly designed...I'll wager that a C# backend, if properly designed, could outperform the current IMAP backend that is written in C <I>and</I> have more functionality.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-77009180514031427342008-05-13T13:01:00.000-04:002008-05-13T13:01:00.000-04:00@JeffreyThe performance argument comes up again an...@Jeffrey<BR/>The performance argument comes up again and again. Yes JIT compiled languages can be faster than C in some cases. But in the general case, they are a lot slower. You know this, so why bring it up?<BR/><BR/>Also claiming that C# regexp is blazingly fast, but only in an incomplete version that isn't even in mainline mono yet is silly. Perhaps it's fast because it's incomplete. You can't really make any judgment until it's released. <BR/><BR/>We've heard the "it'll be faster than C" argument since 95 when Java was released. It was pie in the sky back then, and after 13 years of development it still is. Those languages have plenty of advantages, but performance is not one of them.Leo Shttps://www.blogger.com/profile/02951281972056927807noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-67245360694834738052008-05-13T12:52:00.000-04:002008-05-13T12:52:00.000-04:00The new Regex engine was written during Novell Hac...The new Regex engine was written during Novell HackWeek which Miguel posted a summary about here:<BR/><BR/><A HREF="http://tirania.org/blog/archive/2008/Feb-23.html" REL="nofollow">http://tirania.org/blog/archive/2008/Feb-23.html</A>Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-6358977315057227022008-05-13T12:22:00.000-04:002008-05-13T12:22:00.000-04:00Philip: the tests there haven't been updated with ...Philip: the tests there haven't been updated with the new Regex stuff (which I don't think is even enabled by default in Mono yet because it isn't complete, I don't think)Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-49091202150487034492008-05-13T11:11:00.000-04:002008-05-13T11:11:00.000-04:00http://shootout.alioth.debian.org/debian/benchmark...http://shootout.alioth.debian.org/debian/benchmark.php?test=all&lang=csharp&lang2=gcc<BR/><BR/>I'm missing something, aren't I?Philiphttps://www.blogger.com/profile/06614594496918845905noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-36008162692674299792008-05-13T10:40:00.000-04:002008-05-13T10:40:00.000-04:00As an example of Mono being able to outperform nat...As an example of Mono being able to outperform native C, Mono's new RegularExpressions implementation crushes the C, C++, Java, Perl, Python, etc (all except Tcl) implementations in the Debian Language Shootout.<BR/><BR/>Oh, and when I say it outperforms C... it outperforms both libc regex <I>and</I> PCRE.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-52686905102280277342008-05-13T10:34:00.000-04:002008-05-13T10:34:00.000-04:00np237: you are vastly mistaken about Mono being bl...np237: you are vastly mistaken about Mono being bloatware.<BR/><BR/>C# can outperform native C depending on what you are doing.<BR/><BR/>Also, IMAP is I/O bound, so you're not going to notice any slowness of something written in C# vs C (if you were worth your weight as a programmer, you'd recognize this fact).<BR/><BR/>Instead of broadcasting your ignorance to the world, it might be wise for you to do some actual learning.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-32423800672395471552008-05-13T05:03:00.000-04:002008-05-13T05:03:00.000-04:00It would really be a shame to make evolution depen...It would really be a shame to make evolution depend on bloatware like Mono after the efforts that have been spent in making it consume less memory.<BR/><BR/>As for a Camel provider written in C#, you'd be unable to use it in any serious environment. Code able to manage thousands of emails in hundreds of folders should be written in C, full stop.<BR/><BR/>As for those comparing the memory usage of python and mono: please also compare startup times. Tomboy takes up to 10 seconds to startup on my laptop, during which gnome-panel is unusable. I have yet to see a program in another language (except maybe Java) being so slow to start.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-32990905759667128292008-05-12T10:48:00.000-04:002008-05-12T10:48:00.000-04:00Emmanuele: See http://bugzilla.gnome.org/show_bug....Emmanuele: See http://bugzilla.gnome.org/show_bug.cgi?id=532552<BR/><BR/>I've already written a patch :)Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-30151956855099377032008-05-12T10:34:00.000-04:002008-05-12T10:34:00.000-04:00emmanuele: Yea, altho in the feature request I sub...emmanuele: Yea, altho in the feature request I submitted to bugzilla - I called it g_checksum_reset() - I think that might be a better name?<BR/><BR/>I can certainly live with having to malloc/free a GChecksum instead of having it be on the stack, but a g_checksum_reset() would be awesome ;-)Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-55750388857805480062008-05-12T09:43:00.000-04:002008-05-12T09:43:00.000-04:00@jeff: mmh, perhaps a g_checksum_clear() that just...@jeff: mmh, perhaps a g_checksum_clear() that just reset the internal state and gave you a newly usable GChecksum. would that be enough?Emmanuelehttps://www.blogger.com/profile/14797939115552193382noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-84438129313855579472008-05-11T21:39:00.000-04:002008-05-11T21:39:00.000-04:00Anonymous: You are free to implement a better IMAP...Anonymous: You are free to implement a better IMAP provider for Evolution in C if you'd rather avoid C#.<BR/><BR/>I, myself, am only suggesting the idea because if it comes down to <I>me</I> having to rewrite Evolution's IMAP support, I'd rather do it in C# than in C.<BR/><BR/>But if you were willing to implement an IMAP backend in C, then I'd gladly step back and let you do it :)<BR/><BR/>If you just want to complain, well, then you have no say :)Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-27889208551822538642008-05-11T20:37:00.000-04:002008-05-11T20:37:00.000-04:00I figured this would happen. Even though right no...I figured this would happen. Even though right now mono is just an optional part of Gnome, slowly it will creep more and more into core parts of the platform. Slowly people are realizing that C is inadequate for modern desktop development and unfortunately the progression seems to be to C#. Bye bye lightweight. Not for me thank you.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-9588567028163741582008-05-11T18:53:00.000-04:002008-05-11T18:53:00.000-04:00anonymous: tinymail is already just a wrapper arou...anonymous: tinymail is already just a wrapper around camel. Why would he write a camel wrapper around a wrapper around camel? Makes no sense.<BR/><BR/>Tinymail uses the same imap code as Evolution.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-18210475048075446962008-05-11T18:02:00.000-04:002008-05-11T18:02:00.000-04:00Just do a Camel API wrapper for TinyMail.Just do a Camel API wrapper for TinyMail.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-73310830583964910002008-05-11T16:05:00.000-04:002008-05-11T16:05:00.000-04:00have you considered, as a more mid-to-long-term st...have you considered, as a more mid-to-long-term strategy, using akonadi within evolution?<BR/><BR/>it would be a great way to get more people who actually care about things like getting a good imap implementation, not to mention all the other pieces.<BR/><BR/>as you can see <A HREF="http://www.kdedevelopers.org/node/3456" REL="nofollow">in Kevin Krammer's blog entry here</A> the work on generalizing (or, if you will, de-KDE-ifying) akonadi is progressing really nicely.<BR/><BR/>at LCA this year there was even a presentation on akonadi by one of the gnome developers, so hopefully that interest continues.<BR/><BR/>it's a great area to work together on since things like imap are not sexy for either developers or users; the user interface it's where it's all at, really. the only time the imap implementation becomes interesting at all is when it sucks, so getting everyone working together on these things makes all the sense in the world.<BR/><BR/>it also helps that there are a number of people paid to work on akonadi so the unsexy nature of the work doesn't interfere completely; also, these people seem to actually enjoy working on it. takes all types, i suppose ;)<BR/><BR/>but yeah, definitely check out akonadi. integration and improved user experience ftw! ;)Anonymoushttps://www.blogger.com/profile/06688610708513558784noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-82790912614761198502008-05-11T15:15:00.000-04:002008-05-11T15:15:00.000-04:00I don't knwo why people complain that often about ...I don't knwo why people complain that often about the overhead of Mono.<BR/><BR/>For me Python is a much bigger problem.<BR/><BR/>For example:<BR/>Tomboy uses on my system 16,2MB<BR/>gajim (my Jabber client) in offline mode: 28,1MB + 8,2MB (Python) = 36,3MB<BR/><BR/>For me programs written in python are a much bigger "problem" than C#-apps. I can't understand why so many people hype python as _the_ high level programming language for desktop apps. I'm always happy if i can avoid python apps both for general speed issues and because of the memory consumption. If i have a choice between a python app and a c# app i would always go for the c# one.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-46390726017709974252008-05-11T13:45:00.000-04:002008-05-11T13:45:00.000-04:00Jeffrey: Ack, so I am. My apologies.Jeffrey: Ack, so I am. My apologies.Philiphttps://www.blogger.com/profile/06614594496918845905noreply@blogger.com