Do you know what's also slow?
-
Attempting to greyscale 500 odd (~2329x3500 24bpp) images using IronPython. And I mean sloooooooooooooooooooooooooooooooooow! The sort of sloooooooooooooooooooow that doesn't just necessitate the making of a brew, but also requires you to go out for a very long walk, read the paper, have a nice long nap, have dinner, enjoy some beer in the garden, go to bed feeling a bit drunk and wake up the next morning hoping the process has finished. Of course, I'm not stupid so I did some testing first :) With a single thread each image was taking > 1 minute to process. I managed to improve that a little bit by using some multi-threading savvy and got it down to, a still highly unsatisfactory, 38 seconds. At which point I decided I'd try it in C# instead. The code is pretty much exactly the same as the IronPython implementation, the results somewhat startling. On the same machine, using the same .Net features, a single threaded C# app was able to process each image in .78 seconds (using my rudimentary timing technique). So there you go, chums, IronPython may be quite cool - I like it! - but if you're into doing anything with images I'd probably consider using something else.
-
Attempting to greyscale 500 odd (~2329x3500 24bpp) images using IronPython. And I mean sloooooooooooooooooooooooooooooooooow! The sort of sloooooooooooooooooooow that doesn't just necessitate the making of a brew, but also requires you to go out for a very long walk, read the paper, have a nice long nap, have dinner, enjoy some beer in the garden, go to bed feeling a bit drunk and wake up the next morning hoping the process has finished. Of course, I'm not stupid so I did some testing first :) With a single thread each image was taking > 1 minute to process. I managed to improve that a little bit by using some multi-threading savvy and got it down to, a still highly unsatisfactory, 38 seconds. At which point I decided I'd try it in C# instead. The code is pretty much exactly the same as the IronPython implementation, the results somewhat startling. On the same machine, using the same .Net features, a single threaded C# app was able to process each image in .78 seconds (using my rudimentary timing technique). So there you go, chums, IronPython may be quite cool - I like it! - but if you're into doing anything with images I'd probably consider using something else.
martin_hughes wrote:
that doesn't just necessitate the making of a brew, but also requires you to go out for a very long walk, read the paper, have a nice long nap, have dinner, enjoy some beer in the garden, go to bed feeling a bit drunk and wake up the next morning
martin_hughes wrote:
Of course, I'm not stupid
I see no coherence there. :rolleyes:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
martin_hughes wrote:
that doesn't just necessitate the making of a brew, but also requires you to go out for a very long walk, read the paper, have a nice long nap, have dinner, enjoy some beer in the garden, go to bed feeling a bit drunk and wake up the next morning
martin_hughes wrote:
Of course, I'm not stupid
I see no coherence there. :rolleyes:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Meh... I can do:
martin_hughes wrote:
necessitate the making of a brew, but also requires you to go out for a very long walk, read the paper, have a nice long nap, have dinner, enjoy some beer in the garden, go to bed feeling a bit drunk and wake up the next morning
whenever I want :)
-
Attempting to greyscale 500 odd (~2329x3500 24bpp) images using IronPython. And I mean sloooooooooooooooooooooooooooooooooow! The sort of sloooooooooooooooooooow that doesn't just necessitate the making of a brew, but also requires you to go out for a very long walk, read the paper, have a nice long nap, have dinner, enjoy some beer in the garden, go to bed feeling a bit drunk and wake up the next morning hoping the process has finished. Of course, I'm not stupid so I did some testing first :) With a single thread each image was taking > 1 minute to process. I managed to improve that a little bit by using some multi-threading savvy and got it down to, a still highly unsatisfactory, 38 seconds. At which point I decided I'd try it in C# instead. The code is pretty much exactly the same as the IronPython implementation, the results somewhat startling. On the same machine, using the same .Net features, a single threaded C# app was able to process each image in .78 seconds (using my rudimentary timing technique). So there you go, chums, IronPython may be quite cool - I like it! - but if you're into doing anything with images I'd probably consider using something else.
I doubt that is a problem with the language. Seems like maybe you're using it wrong and decreasing the big-O performance (say, from N to N^2). I could be wrong, but what exactly about the language itself are you expecting is slowing the process down so much (note: I have never used that language, so maybe you are right)?
-
I doubt that is a problem with the language. Seems like maybe you're using it wrong and decreasing the big-O performance (say, from N to N^2). I could be wrong, but what exactly about the language itself are you expecting is slowing the process down so much (note: I have never used that language, so maybe you are right)?
There might be more "Python friendly" ways of doing things, but I don't think there's anything intrinsically wrong with my implementation. Line for line, it's almost exactly the same as the C# version (syntactic differences notwithstanding). Where IronPython seems to hit a bottleneck, in this instance at any rate, is indexing into .Net typed arrays. My guess is the hit comes from all the fancy things IPY does to ensure that whilst it can do all the duck typing and dynamic stuff it can ensure that what it's dealing with is correct at runtime. C# doesn't have that problem having being assured of it all at compile time. Give it a whirl for yourself; Python is quite a nice and friendly language and useful for a lot of things and well worth knowing something about - IronPython doubly so. I'd recommend Guido van Rossum's An Introduction to Python also: not only a useful Python introduction, but also a model of a language introductory book.
-
Attempting to greyscale 500 odd (~2329x3500 24bpp) images using IronPython. And I mean sloooooooooooooooooooooooooooooooooow! The sort of sloooooooooooooooooooow that doesn't just necessitate the making of a brew, but also requires you to go out for a very long walk, read the paper, have a nice long nap, have dinner, enjoy some beer in the garden, go to bed feeling a bit drunk and wake up the next morning hoping the process has finished. Of course, I'm not stupid so I did some testing first :) With a single thread each image was taking > 1 minute to process. I managed to improve that a little bit by using some multi-threading savvy and got it down to, a still highly unsatisfactory, 38 seconds. At which point I decided I'd try it in C# instead. The code is pretty much exactly the same as the IronPython implementation, the results somewhat startling. On the same machine, using the same .Net features, a single threaded C# app was able to process each image in .78 seconds (using my rudimentary timing technique). So there you go, chums, IronPython may be quite cool - I like it! - but if you're into doing anything with images I'd probably consider using something else.
What version of IronPython were you running? The latest one running on .NET 4?
Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro
-
What version of IronPython were you running? The latest one running on .NET 4?
Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro
It's version 2.6.10920.0 on .Net 3.5 SP1.
-
It's version 2.6.10920.0 on .Net 3.5 SP1.
I wonder if the version running on .NET 4 will be faster - with the DLR and all that.
Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro