U++ framework
Do not panic. Ask here before giving up.

Home » Community » U++ community news and announcements » New Core
New Core [message #46381] Tue, 03 May 2016 16:17 Go to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
This week I am in the process to finally switching to "new" Core.

Right now, it is already in trunk and most things are fixed.

New Core is "C++11 only". Details of what is new/changed will be published later.

Anyway, as there is not a 100% compatibility maintained, the most important information is that the 'legacy' U++ will be available at svn://ultimatepp.org/upp/classic and perhaps maintained for some time to go...

Mirek
Re: New Core [message #46388 is a reply to message #46381] Wed, 04 May 2016 09:38 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Hello Mirek

What will be the improvements and where do you expect the compatibility problems may appear?


Best regards
IƱaki
Re: New Core [message #46391 is a reply to message #46388] Wed, 04 May 2016 14:55 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
And what kind of changes are these? Superficial or deeper? Did you manage to clean up the weird more legacy stuff or is it just an update of containers for C++1x?

And speaking of C++14, this version supports 0b1111 like constants. Just today I needed them in CodeEditor. I will submit a patch for it if you think we should support it? Do you?

And if yes, the question is if you want me to add a:

HL_COLOR(INK_CONST_BIN, t_("Binary constant"), 1)

to the highlighting infrastructure or will we reuse some existing color?

Re: New Core [message #46401 is a reply to message #46388] Thu, 05 May 2016 09:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
koldo wrote on Wed, 04 May 2016 09:38
Hello Mirek

What will be the improvements and where do you expect the compatibility problems may appear?


I will detail changes soon (but mostly it is about C++11 and multithreading).

So far, apart for one or two minor changes, suprisingly the most compatibility problems are caused by new Core detecting subtle bugs.

It took me 5 minutes to fix those is my largest app.

Mirek
Re: New Core [message #46405 is a reply to message #46401] Fri, 06 May 2016 10:24 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
mirek wrote on Thu, 05 May 2016 10:26
koldo wrote on Wed, 04 May 2016 09:38
Hello Mirek

What will be the improvements and where do you expect the compatibility problems may appear?


I will detail changes soon (but mostly it is about C++11 and multithreading).

So far, apart for one or two minor changes, suprisingly the most compatibility problems are caused by new Core detecting subtle bugs.

It took me 5 minutes to fix those is my largest app.

Mirek

Ah OK!

I shall wait then!

Honestly, I was hoping for a more substantial update to Core. Most classes are fine as they are, even great, but all the free functions are falling out of favor and considered sub-optimal design nowadays. As an example, all the file name related stuff could be grouped under a class called Path with static members and so on.

I help with remembering where everything goes and what names it has. I often know that there is a free function that solves my problem, but I'm not sure how it is called.

Today I've spent like 5 minutes trying to find the function that copies text to clipboard, only to find that in CtrlCore.h there are things like ClearClipboard and WriteClipboardUnicodeText. Things like this should really be Clipboard::Clear and Clipboard::Write.
Re: New Core [message #46406 is a reply to message #46405] Fri, 06 May 2016 13:10 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
cbpporter wrote on Fri, 06 May 2016 10:24

Today I've spent like 5 minutes trying to find the function that copies text to clipboard, only to find that in CtrlCore.h there are things like ClearClipboard and WriteClipboardUnicodeText. Things like this should really be Clipboard::Clear and Clipboard::Write.

[/quote]

Trouble with this is that Clipboard class is 'closed'. You can put some formats to it, but it is not extensible in another module.

Mirek
Re: New Core [message #46407 is a reply to message #46381] Fri, 06 May 2016 22:53 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Mirek,

I have updated the packaging to use C++11, but TheIDE build still fail. The error says DeepClone is not declared, you can see it in the build logs, e.g. for Debian Wheezy. Could you have a look at it, please?

Honza
Re: New Core [message #46409 is a reply to message #46407] Sun, 08 May 2016 06:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
dolik.rce wrote on Fri, 06 May 2016 22:53
Hi Mirek,

I have updated the packaging to use C++11, but TheIDE build still fail. The error says DeepClone is not declared, you can see it in the build logs, e.g. for Debian Wheezy. Could you have a look at it, please?

Honza


Most likely it is missing MT in main package config.
Re: New Core [message #46410 is a reply to message #46409] Sun, 08 May 2016 15:37 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Sun, 08 May 2016 06:31
Most likely it is missing MT in main package config.

Oh, right, I missed that it is necessary now.

So the situation is much better now. There is just few problems left:

Ubuntu 12.4 and ScientificLinux 6 both fail, because their compiler (GCC 4.6 and 4.7, respectively) is so old it doesn't even support the option -std=c++11. Also the compiler in Debian Wheezy (GCC 4.7) doesn't work. This one already knows c++11, but thread_local keyword is not implemented, so the compilation fails.

And the last problem is in ArchLinux packages where the compilation fails on conflicting declaration of abs(int64), which is already present in stdlib in C++11.

Is it safe to drop support for the old distros, even though they are still supported? Ubuntu 12.4 has end-of-life scheduled for April 2017, Debian Wheezy has LTS until May 2018 and ScientificLinux 6 even has full support until Q2 2017 (and then maintenance updates until November 2020).

Honza
Re: New Core [message #46411 is a reply to message #46381] Sun, 08 May 2016 18:08 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 332
Registered: July 2009
Senior Member
I tried to compile last version (upp-x11-src-9809.tar.gz) from source but it failed with lack of std=c++11.
Where it should be added?
src/Makefile?
src/Makefile.in?
src/UMakefile?

Re: New Core [message #46414 is a reply to message #46410] Mon, 09 May 2016 11:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
dolik.rce wrote on Sun, 08 May 2016 15:37
mirek wrote on Sun, 08 May 2016 06:31
Most likely it is missing MT in main package config.

Oh, right, I missed that it is necessary now.

So the situation is much better now. There is just few problems left:

Ubuntu 12.4 and ScientificLinux 6 both fail, because their compiler (GCC 4.6 and 4.7, respectively) is so old it doesn't even support the option -std=c++11. Also the compiler in Debian Wheezy (GCC 4.7) doesn't work. This one already knows c++11, but thread_local keyword is not implemented, so the compilation fails.

And the last problem is in ArchLinux packages where the compilation fails on conflicting declaration of abs(int64), which is already present in stdlib in C++11.

Is it safe to drop support for the old distros, even though they are still supported? Ubuntu 12.4 has end-of-life scheduled for April 2017, Debian Wheezy has LTS until May 2018 and ScientificLinux 6 even has full support until Q2 2017 (and then maintenance updates until November 2020).

Honza


Perhaps we can switch it to 'classic'?

Mirek
Re: New Core [message #46415 is a reply to message #46411] Mon, 09 May 2016 11:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Zbych wrote on Sun, 08 May 2016 18:08
I tried to compile last version (upp-x11-src-9809.tar.gz) from source but it failed with lack of std=c++11.
Where it should be added?
src/Makefile?
src/Makefile.in?
src/UMakefile?



Sorry, that is a bug in umk. Fixing it now.

Mirek
Re: New Core [message #46418 is a reply to message #46414] Mon, 09 May 2016 16:32 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Mon, 09 May 2016 11:23
dolik.rce wrote on Sun, 08 May 2016 15:37

Is it safe to drop support for the old distros, even though they are still supported? Ubuntu 12.4 has end-of-life scheduled for April 2017, Debian Wheezy has LTS until May 2018 and ScientificLinux 6 even has full support until Q2 2017 (and then maintenance updates until November 2020).


Perhaps we can switch it to 'classic'?


It could be done, if you package the 'classic' uppsrc into the nigthly tarball. I could then try to detect GCC version and set the assembly to classic version if the compiler is too old. It doesn't even need to be whole uppsrc, only packages that are necessary to build theide and umk.

Honza
Re: New Core [message #46419 is a reply to message #46418] Mon, 09 May 2016 17:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
dolik.rce wrote on Mon, 09 May 2016 16:32
mirek wrote on Mon, 09 May 2016 11:23
dolik.rce wrote on Sun, 08 May 2016 15:37

Is it safe to drop support for the old distros, even though they are still supported? Ubuntu 12.4 has end-of-life scheduled for April 2017, Debian Wheezy has LTS until May 2018 and ScientificLinux 6 even has full support until Q2 2017 (and then maintenance updates until November 2020).


Perhaps we can switch it to 'classic'?


It could be done, if you package the 'classic' uppsrc into the nigthly tarball.


Well, I do not. 'classic' is basically branch for systems not supporting C++11.

I perhaps could generate complete 'classic' tarball.

Mirek
Re: New Core [message #46420 is a reply to message #46419] Mon, 09 May 2016 20:51 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Mon, 09 May 2016 17:25
dolik.rce wrote on Mon, 09 May 2016 16:32
mirek wrote on Mon, 09 May 2016 11:23
dolik.rce wrote on Sun, 08 May 2016 15:37

Is it safe to drop support for the old distros, even though they are still supported? Ubuntu 12.4 has end-of-life scheduled for April 2017, Debian Wheezy has LTS until May 2018 and ScientificLinux 6 even has full support until Q2 2017 (and then maintenance updates until November 2020).


Perhaps we can switch it to 'classic'?


It could be done, if you package the 'classic' uppsrc into the nigthly tarball.


Well, I do not. 'classic' is basically branch for systems not supporting C++11.

I perhaps could generate complete 'classic' tarball.

I understand that it is a branch, but I think it could still be present in the tarball as a "fallback" for older systems. It would also be simpler for the users, because having two tarballs requires explaining them in great detail which one they should use...

Also it would save me a lot of work when packaging, because I wouldn't have to keep track of compiler version for each of the 15 distros and manually choose which one should be used. It would be especially troublesome for ubuntu and debian, where all 7 versions is currently built from the same package.

Honza
Re: New Core [message #46425 is a reply to message #46381] Tue, 10 May 2016 00:31 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 826
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Maybe the package should be left as is, and upp2 can be introduced? (like kde4 vs kde5 during transition period)
Or that's too complicated to maintain either?
Re: New Core [message #46433 is a reply to message #46425] Tue, 10 May 2016 18:46 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I'm afraid Web package is not compiled successfully with new Core. Compiling with MSC 14/15 fails on a number of files from Web package.
Re: New Core [message #46439 is a reply to message #46433] Wed, 11 May 2016 10:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Web was planned to be removed. It was DEPRECATED years ago.

Is there anything in Web that you need? I guess I can still fix it...
Re: New Core [message #46440 is a reply to message #46425] Wed, 11 May 2016 10:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
mr_ped wrote on Tue, 10 May 2016 00:31
Maybe the package should be left as is, and upp2 can be introduced? (like kde4 vs kde5 during transition period)
Or that's too complicated to maintain either?


Is not that exactly what happened? 'classic' being left as it is and upp moved on to C++11?

Mirek
Re: New Core [message #46441 is a reply to message #46420] Wed, 11 May 2016 10:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
dolik.rce wrote on Mon, 09 May 2016 20:51
mirek wrote on Mon, 09 May 2016 17:25
dolik.rce wrote on Mon, 09 May 2016 16:32
mirek wrote on Mon, 09 May 2016 11:23
dolik.rce wrote on Sun, 08 May 2016 15:37

Is it safe to drop support for the old distros, even though they are still supported? Ubuntu 12.4 has end-of-life scheduled for April 2017, Debian Wheezy has LTS until May 2018 and ScientificLinux 6 even has full support until Q2 2017 (and then maintenance updates until November 2020).


Perhaps we can switch it to 'classic'?


It could be done, if you package the 'classic' uppsrc into the nigthly tarball.


Well, I do not. 'classic' is basically branch for systems not supporting C++11.

I perhaps could generate complete 'classic' tarball.

I understand that it is a branch, but I think it could still be present in the tarball as a "fallback" for older systems. It would also be simpler for the users, because having two tarballs requires explaining them in great detail which one they should use...
Honza


Not sure. For starters, it will complicate the tarball. Either I will have to include both source trees, or invent some patching.

I really would like to keep 'classic' as separate thing. Like gtk2-gtk3, KDE4/5 etc.. Those are not coming in single tarball, right? Smile
Re: New Core [message #46442 is a reply to message #46388] Wed, 11 May 2016 10:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
koldo wrote on Wed, 04 May 2016 09:38
Hello Mirek

What will be the improvements and where do you expect the compatibility problems may appear?


Here is the brief summary:

http://www.ultimatepp.org/srcdoc$Core$Core2016$en-us.html
Re: New Core [message #46445 is a reply to message #46439] Wed, 11 May 2016 15:30 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

mirek wrote on Wed, 11 May 2016 11:33
Web was planned to be removed. It was DEPRECATED years ago.

Is there anything in Web that you need? I guess I can still fix it...


Oh, sorry I wasn't aware of deprecated status of Web package.
After looking into code, it looks like HttpQuery is the only dependant class from Web package I still use.
Re: New Core [message #46446 is a reply to message #46445] Wed, 11 May 2016 15:32 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
Mindtraveller wrote on Wed, 11 May 2016 16:30
mirek wrote on Wed, 11 May 2016 11:33
Web was planned to be removed. It was DEPRECATED years ago.

Is there anything in Web that you need? I guess I can still fix it...


Oh, sorry I wasn't aware of deprecated status of Web package.
After looking into code, it looks like HttpQuery is the only dependant class from Web package I still use.

Really? I had no idea Smile.

What are we supposed to use instead?
Re: New Core [message #46447 is a reply to message #46446] Wed, 11 May 2016 18:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
cbpporter wrote on Wed, 11 May 2016 15:32
Mindtraveller wrote on Wed, 11 May 2016 16:30
mirek wrote on Wed, 11 May 2016 11:33
Web was planned to be removed. It was DEPRECATED years ago.

Is there anything in Web that you need? I guess I can still fix it...


Oh, sorry I wasn't aware of deprecated status of Web package.
After looking into code, it looks like HttpQuery is the only dependant class from Web package I still use.

Really? I had no idea Smile.

What are we supposed to use instead?


For years, there is a superior alternative in Core, HttpRequest. It can handle much more of http and is (if needed) async.

E.g.

http://www.codeproject.com/Articles/1068378/Simple-multi-req uest-web-crawler-using-Uplusplus


Mirek
Re: New Core [message #46448 is a reply to message #46447] Thu, 12 May 2016 03:04 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
Which is the last "old core" version. For bookmarking Smile.
Re: New Core [message #46449 is a reply to message #46381] Thu, 12 May 2016 04:45 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
I'm still getting crashes with the new core and mingw x64 (tdm-gcc 5.1). My app is crashing in Optimal and Size configurations. It is crashing with and without SSE2 flag. BLITZ is disabled, precompiled headers are enabled. x86 configuration seems to be fine.

Interestingly, cc1plus.exe is crashing when I'm trying to compile Optimal with debug info Smile

Update: I've checked mingw 5.3.0 x64 Optimal with debug info. I can get a call stack. It is crashing in Upp::Rect_<int>::Rect_, which is inside of Upp::Ctrl::CtrlPaint.

Thanks.


Regards,
Novo

[Updated on: Thu, 12 May 2016 06:03]

Report message to a moderator

Re: New Core [message #46450 is a reply to message #46441] Thu, 12 May 2016 06:42 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Wed, 11 May 2016 10:40
dolik.rce wrote on Mon, 09 May 2016 20:51
mirek wrote on Mon, 09 May 2016 17:25
I perhaps could generate complete 'classic' tarball.

I understand that it is a branch, but I think it could still be present in the tarball as a "fallback" for older systems. It would also be simpler for the users, because having two tarballs requires explaining them in great detail which one they should use...
Honza


Not sure. For starters, it will complicate the tarball. Either I will have to include both source trees, or invent some patching.

I really would like to keep 'classic' as separate thing. Like gtk2-gtk3, KDE4/5 etc.. Those are not coming in single tarball, right? Smile

Ok, it'll be more complicated, but I guess I can make it work somehow with two distinct tarballs. Please let me know when the classic archive is ready.

BTW: What about the issue with Arch Linux, did you look at it? I'm totally swamped lately, so I didn't have time to investigate it at all Sad

Honza
Re: New Core [message #46451 is a reply to message #46449] Thu, 12 May 2016 09:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Novo wrote on Thu, 12 May 2016 04:45
I'm still getting crashes with the new core and mingw x64 (tdm-gcc 5.1). My app is crashing in Optimal and Size configurations. It is crashing with and without SSE2 flag. BLITZ is disabled, precompiled headers are enabled. x86 configuration seems to be fine.

Interestingly, cc1plus.exe is crashing when I'm trying to compile Optimal with debug info Smile

Update: I've checked mingw 5.3.0 x64 Optimal with debug info. I can get a call stack. It is crashing in Upp::Rect_<int>::Rect_, which is inside of Upp::Ctrl::CtrlPaint.

Thanks.


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
Re: New Core [message #46455 is a reply to message #46447] Thu, 12 May 2016 15:10 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

mirek wrote on Wed, 11 May 2016 19:40
For years, there is a superior alternative in Core, HttpRequest. It can handle much more of http and is (if needed) async.

Yes, I was aware of the HttpRequest alternative. But HttpQuery represented slightly different functionality. It gave a number of useful routines for URL parsing. I used it in http server code to parse URL variables of incoming http request.
		while (!shutdown)
		{
			if (server->IsError())
			{
				server.Clear();
				server.Create().Listen(answerPort,100);
				Sleep(200);
			}
			TcpSocket socket;
			socket.Timeout(2000);
			if (!socket.Accept(*server))
			{
				Sleep(50);
				continue;
			}
			
			HttpHeader http;
			http.Read(socket);
			int len = static_cast<int>(http.GetContentLength());
			if (len > 0)
				socket.GetAll(len);
			
			HttpQuery query(http.GetURI());
			
			String rq = query.GetString("RQ"); // this is where HttpQuery is actually used
		
			if (rq == "REQ1")
			{
			}
			else if (rq == "REQ2")
			{
			}
			else if (rq == "REQ3")
			{
			}
...
Re: New Core [message #46456 is a reply to message #46451] Thu, 12 May 2016 16:23 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
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.
Another interesting thing. A quote from documentation: "-Os: optimizes code for size. It activates all -O2 options that do not increase the size of the generated code. It can be useful for machines that have extremely limited disk storage space and/or CPUs with small cache sizes."
So, basically, -Os is -O2 with some limitations.

Thanks.


Regards,
Novo

[Updated on: Thu, 12 May 2016 16:25]

Report message to a moderator

Re: New Core [message #46457 is a reply to message #46381] Thu, 12 May 2016 17:08 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
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
  • Attachment: mingw.patch
    (Size: 5.67KB, Downloaded 305 times)


Regards,
Novo

[Updated on: Fri, 13 May 2016 00:20]

Report message to a moderator

Re: New Core [message #46461 is a reply to message #46457] Thu, 12 May 2016 19:29 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
And a question: I can fully understand the 16 bit alignment for allocation and I've used a lot in the past SSE, so this is a good move.

But why make the smallest allocation size 32, not 16?
Re: New Core [message #46468 is a reply to message #46461] Fri, 13 May 2016 16:48 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
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 .
Re: New Core [message #46469 is a reply to message #46468] Fri, 13 May 2016 17:05 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
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?
Re: New Core [message #46474 is a reply to message #46461] Sat, 14 May 2016 07:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
cbpporter wrote on Thu, 12 May 2016 19:29
And a question: I can fully understand the 16 bit alignment for allocation and I've used a lot in the past SSE, so this is a good move.

But why make the smallest allocation size 32, not 16?


It is related to the implementation of allocator.

In short: There are small blocks and there are large blocks. At some point, I need to know if freed block is small or large. Fast method to do that is to use single bit in address - small blocks are always 32 bytes aligned, large blocks are 32 bytes misaligned. Therefore small block has to be multiple of 32.

Previous core used the same process, but 16 byte misalignment. So the smallest block was 16 bytes and alignment 8 bytes.

Of course, I have tested this (with theide and other apps) and the increase in memory consumption is negligible.
Re: New Core [message #46475 is a reply to message #46456] Sat, 14 May 2016 07:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
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
Re: New Core [message #46476 is a reply to message #46450] Sat, 14 May 2016 08:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
dolik.rce wrote on Thu, 12 May 2016 06:42

BTW: What about the issue with Arch Linux, did you look at it? I'm totally swamped lately, so I didn't have time to investigate it at all Sad

Honza


Hopefully fixed (I have just removed our abs definitions, which were there to support old compilers...)
Re: New Core [message #46477 is a reply to message #46457] Sat, 14 May 2016 08:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Novo wrote on Thu, 12 May 2016 17:08

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 ...


You would need "cross-compling" ide... (does not exist at the moment).

Why not just use wine and current nightly build? Works like charm. (Actually, nightly build is built this way - wine mingw).

Mirek


Re: New Core [message #46478 is a reply to message #46455] Sat, 14 May 2016 09:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Thu, 12 May 2016 15:10
mirek wrote on Wed, 11 May 2016 19:40
For years, there is a superior alternative in Core, HttpRequest. It can handle much more of http and is (if needed) async.

Yes, I was aware of the HttpRequest alternative. But HttpQuery represented slightly different functionality. It gave a number of useful routines for URL parsing. I used it in http server code to parse URL variables of incoming http request.
		while (!shutdown)
		{
			if (server->IsError())
			{
				server.Clear();
				server.Create().Listen(answerPort,100);
				Sleep(200);
			}
			TcpSocket socket;
			socket.Timeout(2000);
			if (!socket.Accept(*server))
			{
				Sleep(50);
				continue;
			}
			
			HttpHeader http;
			http.Read(socket);
			int len = static_cast<int>(http.GetContentLength());
			if (len > 0)
				socket.GetAll(len);
			
			HttpQuery query(http.GetURI());
			
			String rq = query.GetString("RQ"); // this is where HttpQuery is actually used
		
			if (rq == "REQ1")
			{
			}
			else if (rq == "REQ2")
			{
			}
			else if (rq == "REQ3")
			{
			}
...


I see.

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

void Http::ParseRequest(const char *p)
{
	while(*p) {
		const char *last = p;
		while(*p && *p != '=' && *p != '&')
			p++;
		String key = UrlDecode(last, p);
		if(*p == '=')
			p++;
		last = p;
		while(*p && *p != '&')
			p++;
		if(*key != '.' && *key != '@') {
			if(key.EndsWith("[]")) {
				Value &v = var.GetAdd(key);
				if(v.IsNull())
					v = ValueArray();
				(ValueArray &)v << UrlDecode(last, p);
			}
			else
				var.GetAdd(key) = UrlDecode(last, p);
		}
		if(*p)
			p++;
	}
}

Re: New Core [message #46479 is a reply to message #46478] Sat, 14 May 2016 23:57 Go to previous messageGo to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

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.
Previous Topic: Core: New String methods
Next Topic: ide: Optimal mode removed
Goto Forum:
  


Current Time: Mon Apr 27 21:50:52 GMT+2 2026

Total time taken to generate the page: 0.01658 seconds