Discussion:
[Shedskin-list] Newer MinGW and more
b***@mailas.com
2007-12-28 18:35:24 UTC
Permalink
I have tried the newer unofficial MinGW and it works for me, so on Win
we may use this to compile SS code:
http://www.develer.com/oss/GccWinBinaries


In the meantime I have also seen that there may be ways to speed up the
usage of virtual functions by SS... using a really simple "inline
caching" of the most commonly called method, SS may find it out, and it
may speed up SS code some (probably not much than 5-8%).

Bye,
bearophile
--
http://www.fastmail.fm - Email service worth paying for. Try it for free
Mark Dufour
2007-12-29 11:47:22 UTC
Permalink
hi bearo,
Post by b***@mailas.com
I have tried the newer unofficial MinGW and it works for me, so on Win
http://www.develer.com/oss/GccWinBinaries
thanks for mentioning. nice to hear _someone_ is upgrading mingw :)
did you run all unit tests?
Post by b***@mailas.com
In the meantime I have also seen that there may be ways to speed up the
usage of virtual functions by SS... using a really simple "inline
caching" of the most commonly called method, SS may find it out, and it
may speed up SS code some (probably not much than 5-8%).
yes, although it seems more like a task for the C++ compiler. actually
there are some C++ compilers that do this, I think (vortex, perhaps?).

it may be interesting to to list some important optimizations that can
make the output of SS even more efficient:

-escape analysis: transform heap allocation into stack allocation
where possible
-static preallocation: similarly statically preallocate memory,
sharing memory for sites that cannot be 'active' at the same time
-optimize virtual methods (again, I think this is more of a task for
the C++ compiler)
-optimize away bounds checks (a simple analysis can work well in many cases)
-optimize away wrap-around checks (a[-i] = a[len(a)-i])
-ad hoc optimization for many common constructs (such as s[i] == t[j],
s and t strings), ugly but effective
-make short tuples copy-by-value, instead of allocating them on the heap
-replace the STL hash_set implementation by something more efficient
(or perhaps C++0x will have builtin union etc. methods)


thanks,
mark.
--
"One of my most productive days was throwing away 1000 lines of code"
- Ken Thompson
Loading...