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 » Refactored Value coming....
Refactored Value coming.... [message #35129] Sun, 15 January 2012 19:02 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I have spent last 3 weeks refactoring Value, the goal being that most of standard values (like String or int) should be "small value optimized" (in the end, interface allows user-defined types to be svo stored as well).

In the end, I believe that I have succeeded. sizeof(Value) grew to 16, but any standard value exept WString, Complex, ValueMap and ArrayMap are now stored 'directly' into those 16 bytes (older implementation always used reference counted shared data).

I have to say I have expected better improvements in terms of speed; what I am getting in syntetic benchmarks is about 40% improvement. But some operations are significantly faster; e.g. storing int to Value is now just two CPU dword assignements (before it involved allocating memory and setting up shared object), likewise extracting int from Value is about 4x faster now.

Plus, memory consumption should be better too.

Means, despite some disappointment, new Value implementation is better - and I have cleaned the interface a bit too. So it will go into mainline sources, but there is no hurry. This is significant change and I would like more testing (despite the fact I have tried to unit-test this as much as possible).

New Core with svo_value is here:

svn://www.ultimatepp.org/upp/branches/svo_value

and I would like to ask everybody, for the sake of breaking/non-breaking your code, please try to checkout this, compile your mission critical (or not) projects with this new Value implementation and report any irregularities!

I think I will be finally merging svo_value sometimes in March. So please, test before that Smile

Mirek
Re: Refactored Value coming.... [message #35131 is a reply to message #35129] Mon, 16 January 2012 12:13 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
I'll check it out. Sound good.

But I must ask: how did you fit a 16 byte String into a 16 byte Value?
Re: Refactored Value coming.... [message #35132 is a reply to message #35131] Mon, 16 January 2012 15:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 16 January 2012 06:13

I'll check it out. Sound good.

But I must ask: how did you fit a 16 byte String into a 16 byte Value?


By adding something to the String, obviously Wink

Mirek
Re: Refactored Value coming.... [message #35148 is a reply to message #35132] Tue, 17 January 2012 11:45 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi mirek..

sounds really good..
did you spend any time on easying the export of custom objects to Value too? remember Null handling Smile

cheers
Re: Refactored Value coming.... [message #35149 is a reply to message #35148] Tue, 17 January 2012 11:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Tue, 17 January 2012 05:45

hi mirek..

sounds really good..
did you spend any time on easying the export of custom objects to Value too? remember Null handling Smile

cheers


Null handling stays at your proposed SetNull.

I would say that things are not worst that they were (and it is backward compatible too).

Mirek
Re: Refactored Value coming.... [message #35150 is a reply to message #35149] Tue, 17 January 2012 12:25 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Mirek

I have got these errors just after including new Core files from svo_value:

In Sql/Sql.h I get this error:
c:\upp\uppsrc\sql\Sqls.h(27) : error C2660: 'Upp::String0::IsString' : function does not take 1 arguments


Perhaps IsString(q) would have to be changed to ::IsString(q).

In addition I get this in Core/Defs.h:
C:\upp\uppsrc\Core/Defs.h(353) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const Upp::Nuller' (or t
	here is no acceptable conversion)
        c:\upp\uppsrc\sql\Sqls.h(31): could be 'Upp::SqlRaw &Upp::SqlRaw::operator =(const Upp::SqlRaw &)'
        while trying to match the argument list '(Upp::SqlRaw, const Upp::Nuller)'
        c:\upp\uppsrc\core\Value.hpp(203) : see reference to function template instantiation 'void Upp::SetNull<T>(T &)' being compiled
        with
        [
            T=Upp::SqlRaw
        ]
        c:\upp\uppsrc\core\Value.hpp(224) : see reference to function template instantiation 'const T &Upp::GetStaticNull<T>(void)' being compi
	led
        with
        [
            T=Upp::SqlRaw
        ]
        c:\upp\uppsrc\core\Value.hpp(304) : see reference to function template instantiation 'const T &Upp::Value::Get<T>(void) const' being co
	mpiled
        with
        [
            T=Upp::SqlRaw
        ]
        c:\upp\uppsrc\core\Value.hpp(304) : while compiling class template member function 'const Upp::SqlRaw &Upp::RawValue<T>::Extract(const 
	Upp::Value &)'
        with
        [
            T=Upp::SqlRaw
        ]
        c:\upp\uppsrc\sql\Sqls.h(24) : see reference to class template instantiation 'Upp::RawValue<T>' being compiled
        with
        [
            T=Upp::SqlRaw
        ]


Best regards
Iñaki
Re: Refactored Value coming.... [message #35153 is a reply to message #35150] Tue, 17 January 2012 13:48 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 17 January 2012 06:25

Hello Mirek

I have got these errors just after including new Core files from svo_value:

In Sql/Sql.h I get this error:
c:\upp\uppsrc\sql\Sqls.h(27) : error C2660: 'Upp::String0::IsString' : function does not take 1 arguments




This one should already be fixed.

Quote:


In addition I get this in Core/Defs.h:
C:\upp\uppsrc\Core/Defs.h(353) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const Upp::Nuller' (or t
	here is no acceptable conversion)
        c:\upp\uppsrc\sql\Sqls.h(31): could be 'Upp::SqlRaw &Upp::SqlRaw::operator =(const Upp::SqlRaw &)'
        while trying to match the argument list '(Upp::SqlRaw, const Upp::Nuller)'
        c:\upp\uppsrc\core\Value.hpp(203) : see reference to function template instantiation 'void Upp::SetNull<T>(T &)' being compiled
        with
        [
            T=Upp::SqlRaw
        ]
        c:\upp\uppsrc\core\Value.hpp(224) : see reference to function template instantiation 'const T &Upp::GetStaticNull<T>(void)' being compi
	led
        with
        [
            T=Upp::SqlRaw
        ]
        c:\upp\uppsrc\core\Value.hpp(304) : see reference to function template instantiation 'const T &Upp::Value::Get<T>(void) const' being co
	mpiled
        with
        [
            T=Upp::SqlRaw
        ]
        c:\upp\uppsrc\core\Value.hpp(304) : while compiling class template member function 'const Upp::SqlRaw &Upp::RawValue<T>::Extract(const 
	Upp::Value &)'
        with
        [
            T=Upp::SqlRaw
        ]
        c:\upp\uppsrc\sql\Sqls.h(24) : see reference to class template instantiation 'Upp::RawValue<T>' being compiled
        with
        [
            T=Upp::SqlRaw
        ]


[/quote]

Not sure what this means; so far I was using svo_value to compile ide (and I am running it now) in Win32 and for skylark development in Linux64 (there I have noticed and fixed the first bug). I have not encountered the second issue so far. Perhpas it depend on code compiled?

Mirek
Re: Refactored Value coming.... [message #35157 is a reply to message #35153] Tue, 17 January 2012 14:28 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Mirek

Perhaps second problem comes from the solution I did for first problem.

I will update today the sources and I will try it again.


Best regards
Iñaki
Re: Refactored Value coming.... [message #35163 is a reply to message #35157] Wed, 18 January 2012 09:17 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Mirek

The first problem still remains for me.


Best regards
Iñaki
Re: Refactored Value coming.... [message #35177 is a reply to message #35163] Thu, 19 January 2012 11:39 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Mirek

Solved!. In a first test my main programs work perfectly.


Best regards
Iñaki
Re: Refactored Value coming.... [message #35310 is a reply to message #35177] Mon, 30 January 2012 15:56 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
After noticing that branch diverged to the point that svn is not able to merge trunk into it anymore, I have manually reintegrated svo_value branch into trunk as conditional compilation code. You can now add "SVO_VALUE" flag to main config and trunk provides the new Value implementation.
Previous Topic: SqlCtrls - 'automatic' mode and reference example
Next Topic: Sql column Ids now escaped
Goto Forum:
  


Current Time: Tue Apr 16 14:07:08 CEST 2024

Total time taken to generate the page: 0.01934 seconds