Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » New Core
Re: New Core [message #46492 is a reply to message #46479] Sun, 15 May 2016 20:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Sat, 14 May 2016 23:57
mirek wrote on Sat, 14 May 2016 10:03

I see.

Well, looks like we need to move this piece of code from Skylark to Core, right?


Yes. It will be handy little addition.


So this is now in Core:

UrlInfo f("http://username:password@hostname:9090/path?arg=value&aarg[]=item1&aarg[]=item2#anchor");

f.url = http://username:password@hostname:9090/path?arg=value&aarg[]=item1&aarg[]=item2#anchor
f.scheme = http
f.host = hostname
f.port = 9090
f.user = username
f.password = password
f.path = /path
f.query = arg=value&aarg[]=item1&aarg[]=item2
f.fragment = anchor
f.parameters = {arg: value}
f.array_parameters = {aarg: [item1, item2]}


Re: New Core [message #46502 is a reply to message #46469] Tue, 17 May 2016 11:18 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
cbpporter wrote on Fri, 13 May 2016 18:05
cbpporter wrote on Fri, 13 May 2016 17:48
I've been slightly reluctant with the changes since I'm suing an older compiler.

And while I'm not sure I'll switch over to the new core, I'm done with the old compiler. In some micro benchmarks with VS2010, my code runs 4 times slower than with MINGW with 100000 iterations.

So I'm done with VS2010 Laughing Laughing .

Well, MSC11 is not any better than 10.

I'll try the latest MSC on Monday.

But can actually MINGW or TDM or whatever is called be actually so good at optimizing my code or is there something else going on?


Quote:

But can actually MINGW or TDM or whatever is called be actually so good at optimizing my code or is there something else going on?


Nope, of course not. While I have full respect for GCC and it's family, I am yet to see a it have a 2 to 4 times better performance in the generated code than it's competitors.

Changing compilers around and having the same bad performance led me to disregard what is changing as a non-contributing factor and focus my attention on what was constant.

And I was right: it was TheIDE. The settings for "Optimal" cause the performance degrade. Switching to speed makes the performance be roughly equal to TDM with Optimal. But TDM with Speed is even faster.

So what is up with "Optimal". I can see that it uses /O1. That is the option for "optimized for speed" from MSC. MSC recommends /O2 for release builds. Why does Optimal do /O1 and what is the difference then between Optimal and Size.


And more importantly: why was I compiling with "Optimal" for years now?

Good thing that I caught it. I was just about to write a blog post detailing the horrible performance of MSC10 and singing the praises of GCC. I would have made a fool of myself publicly when no one else could have gotten the same results in the benchmarks Smile.
Re: New Core [message #46507 is a reply to message #46502] Wed, 18 May 2016 14:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I guess you misunderstand Optimal mode.

-O1 is "optimize for size"

Optimal mode means "optimize for size unless told otherwise". You can "tell otherwise" by activating "optimize for speed" in either package or file settings.

The motivation here was that majority of code does not have impact on speed. So you can just mark some files or packages to be speed optimized and save size elsewhere. You can e.g. look at Core and see which files are speed optimized (they have little "F" on them, as "FAST").

That said, maybe whole that thing is over-engineered. It dates some 15 years back when it was still important to fit something on 3.5inch diskettes (yes, U++ remembers such times) and having .exe 1.2MB instead of 1.7MB was still a big deal.
Re: New Core [message #46509 is a reply to message #46507] Wed, 18 May 2016 14:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
P.S.: Funny fact, theide 64 optimal size is 15920KB, speed is 17354KB. I guess I will drop this confusion soon...
Re: New Core [message #46511 is a reply to message #46509] Wed, 18 May 2016 15:24 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
mirek wrote on Wed, 18 May 2016 15:36
P.S.: Funny fact, theide 64 optimal size is 15920KB, speed is 17354KB. I guess I will drop this confusion soon...

I tested it too and it is 400 KiB on my 32 bit exe.

But a round trip (and not necessarily round trip, works one way too) conversion from Int to String is about 3 time "slower" on size for 100 million iterations than on "speed". And this with a bunch of hacks I added to speed it up. Without, it is even slower. So I'm sticking with -O2 from now on. I would have never used anything else but TheIDE made this choice for me.

It would be great if at least this would be less confusing.

Optimal means optimal. It means that either it is everybody else's optimal, i.e. Microsoft's or the open source community's recommendation or your personal best pick if you think you know better. Nobody understand though optimal -O1! -O1 on GCC means optimized, but do cheap as compile time optimizations and on MSC means optimize if it doesn't increase code size.
Re: New Core [message #46514 is a reply to message #46511] Wed, 18 May 2016 20:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Wed, 18 May 2016 15:24
mirek wrote on Wed, 18 May 2016 15:36
P.S.: Funny fact, theide 64 optimal size is 15920KB, speed is 17354KB. I guess I will drop this confusion soon...

I tested it too and it is 400 KiB on my 32 bit exe.

But a round trip (and not necessarily round trip, works one way too) conversion from Int to String is about 3 time "slower" on size for 100 million iterations than on "speed". And this with a bunch of hacks I added to speed it up. Without, it is even slower. So I'm sticking with -O2 from now on.


This absolutely expected.

Quote:

I would have never used anything else but TheIDE made this choice for me.


Have you told it that your package/file needs to be speed optimized?

Quote:

Optimal means optimal.


Exactly. Optimal .exe is as small as possible and as fast as possible. By optimizing for speed only what is necessary, you can achieve that goal.

Anyway, while this is sound idea, as I said 10% in size is not worth the trouble. So from the next release on, it will be just speed.

Mirek
Re: New Core [message #46515 is a reply to message #46514] Wed, 18 May 2016 21:53 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
cbpporter wrote on Thu, 12 May 2016 04:04
Which is the last "old core" version. For bookmarking Smile.

And not just for bookmarking. For bug-fixing and submitting test-cases. I'm a bit stuck. I need to patch both my code and submit one for TheIDE to detect better older compiler versions. I know that it is legacy mode and no longer supported, but there is still autodecting code, which doesn't work as good as it should. So either remove it or fix it. I really need to take my ugly code and write a package that autodetects really well the compiler versions and add it to bazaar and as a dependency in my code.

Then I'm finding bugs left and right, some probably just because I'm doing something wrong, but at least one is in U++, but I can't compile yet with the new core.

Then I'm stuck since my command line project is not supposed to support C++11, but it is also used as a library by the GUI, which doesn't care about C++ version. So if I update, I need to make my code old school C++ and use U++ Core in a way that compiles at least on both.

mirek wrote on Wed, 18 May 2016 21:44

Anyway, while this is sound idea, as I said 10% in size is not worth the trouble. So from the next release on, it will be just speed.

Speed and size is fine.

Actually, I'm having this problem too. I need to support MSC, several versions, TDM, Clang overrides for them, Linux G++ and Linux Clang.

And they hate to agree upon what option means what Smile. So I'm thinking of only supporting two options, Debug and Release, and to have compiler dependent options as overrides. For MSC: O1, O2, Ox and Od. For G++: O0-O3 and Os. So I'm thinking of adding these options to the GUI based on compiler and no even trying to give them meaningful names. Debug and Release come with sensible defaults and if you touch the Onn options, it means you know what you are doing.
Re: New Core [message #46525 is a reply to message #46515] Sat, 21 May 2016 01:22 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Well... today I updated from svn and I got the "nice" surprise on my windows box Sad
I guess it's time to fix some code and, the hard part, the Protect package.
I hope to find some spare time....
Re: New Core [message #46530 is a reply to message #46525] Sat, 21 May 2016 13:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mdelfede wrote on Sat, 21 May 2016 01:22
Well... today I updated from svn and I got the "nice" surprise on my windows box Sad
I guess it's time to fix some code and, the hard part, the Protect package.
I hope to find some spare time....


You can still use 'classic' instead of trunk.
Re: New Core [message #46531 is a reply to message #46457] Sat, 21 May 2016 13:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Thu, 12 May 2016 17:08
Another thing.

Could you please convert all Windows-related include file names to lower case? They are all lower case with mingw on Linux.
It looks like this is the right time to do that.

A patch file created by git looks weird, but still ...
You need to use WIN32 flag with mingw on Linux, and TheIDE won't handle rc-files.

Update: if I use WIN32 flag along with GUI and MT, then I get a problem with rc-files. If I just add a -DflagWIN32 common option, then everything compiles, but TheIDE is still linking against Linux libs ...

I guess I'm missing something.

TIA


Patch applied (I do not think it will solve your issues, but it does not harm either).
Re: New Core [message #46575 is a reply to message #46475] Fri, 03 June 2016 01:23 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Sat, 14 May 2016 01:59
Novo wrote on Thu, 12 May 2016 16:23
mirek wrote on Thu, 12 May 2016 03:09

Weird. That is the place it was always crashing, before I have fixed it with 'finetuning' -O options.

Are you using "Instant setup" default options?

Mirek


No, I was using old -O3 and -Os options.
Replacing -Os with -O2 fixed crashes with Optimal and Size configuration.
I didn't change -O3 to -O2 for the Speed configuration.
I do not understand where you are taking options for the Optimal configuration from. They are not declared explicitly anywhere.


I do not quite understand the question. I was just combining until it worked. Then adjusted 'instant setup' to found options.

BTW, my hypothesis here is that it is a bug linker that makes it impossible to combine size and speed optimized code (after all, there are no issues in Posix). Perhaps something related to inlines (-O3 is more aggresive in inlining everything). SO whatever, all is now -O2.

Mirek

I was trying to say that "Optimal" was hard-coded somewhere, and there was no way to change it without recompilation of TheIDE. Anyway, it is gone now.


Regards,
Novo
Previous Topic: Core: New String methods
Next Topic: ide: Optimal mode removed
Goto Forum:
  


Current Time: Sat Apr 20 04:21:22 CEST 2024

Total time taken to generate the page: 0.02415 seconds