#101 Re: mORMot 1 » mORMot over OleDB » 2011-06-14 09:50:34

Yes,

I think something like that would cool.

Because I think framework is the best place for it. Even if it needs some (specific) table(s) (specific structure) to log the changes or what ever the mechanism would be.

And other point is the there is no need to anyone to solve this same problem if they need the Undo/Redo. And most likely there must be some kind of separation by user (or other entity). So that it is not just an undo for changes at general, but undo by some id, and maybe from middle the "change queue". If just possible.

Maybe user must write some handlers and/or event handlers. To help the Framework do it's job correctly regarding to the Undo/Redo feature. But still. Easier the feature is to implement and more flexible it is. I think that would be very strong selling point for the framework...

-TP-

#102 Re: Low level and performance » How to write fast multi-thread Delphi applications » 2011-06-14 09:41:32

ab wrote:

And I'm hoping that ThreadSmart is also ThreadSafe: I've already seen applications running very fast... until they crash... wink

Code snippets are a very good idea.
I'll look into it. There are a lot of code sample of those techniques in the framework, so a simple copy & paste should be good enough...

Yes, if you don't mind, that would be very good.

And My idea of ThreadSmart would be also the ThreadSafe, but smarter wink

.-TP-.

#103 Re: Low level and performance » How to write fast multi-thread Delphi applications » 2011-06-14 05:16:54

Hello,

I have been thinking of two terms that should be used.

ThreadSafe - For code that works in multithreaded environment, don't crash and works as expected. (what it means big_smile )

ThreadSmart - That runs very fast and is (maybe) best solution wink

Basically some guidelines, as mentioned above are very very important. To help programmer to look for own code to make it better.

I just like to make challenge to someone(s) to start keeping up (a blog) document where would be up to date list of these. And I would like to have some kind of example codes sniplets.

Code Before and After from ThreadSafe to ThreadSmart wink Because this way it would be much more clear. We all have not very good English, me included, but we all speak Pascal. So it would be the universal language for all of us. This would help all very very much (And when I am talking of Someone I am not talking of that it necessarily should be  Arnaud Bouchez, he has done so much already)

-Tee-

#104 Re: mORMot 1 » mORMot over OleDB » 2011-06-14 05:06:52

Hello,

I am not sure that we are on the same page, but basically I mean that user must have to have possibility do multistage undo (and redo also, as you mention).

If you make 10 changes, you should be able to step back those 10 and then start again if you want to. and IMHO it is the job of the framework, not an "application" to make the support for undo/redo steps. If you can tweak it (etc) that is bonus. But just rollback multiple commits (one or multiple steps), would be cool....

-Tee-

#105 Re: mORMot 1 » mORMot over OleDB » 2011-06-13 05:00:31

OK,

Like all normal programs, Undo is very very important feature. And if there is some kind of support to save the changes at the serverside. Undo should be doable. (To work it would need some kind of table structure to save all the changes).

But multistage Undo would be a must feature in my point of view. Does not matter how it is done. But basically almost any kind of app would need an Undo, or at least would make it much better. I've been developing an application that did not have Undo, and it really made everything so bad (for User). Users had to really think very carefully what to do. And in many cases they did not have courage to do any changes even they needed to. Because there was no way back.

I think that any framework that sits between (G)UI and DB should have undo. Way or other...

-TP-

#106 Re: mORMot 1 » mORMot over OleDB » 2011-06-10 11:40:38

Hello,

Sounds good. But one feature, I think, is a MUST have.

Undo. Possibility make easy undo of operations done into the database. BEcause coding it at higher level is pain. and I think ORM/Persistence framework must have built  in support or Undo.

just my $0.02

-Tee-

#107 Re: Low level and performance » How to write fast multi-thread Delphi applications » 2011-06-10 04:30:52

Hope that TTextWriter is not a Female then big_smile

(Sorry could not resist)

#108 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-12-30 05:34:08

Good to hear that there is an progress.

I was just pondering how ScaleMM will work with large blocks.

Allocating and Disposing is locked, because of FastMM (etc) underneath, but how about using them, like copying smaller blocks for processing etc... Will that be lock free? I Suppose so... (Just to try to understand where this is currently)

I need ScaleMM for one server, but quite often it uses large blocks, they are owned by each thread (so no cross thread usage), but just been thinking that operations on those are blocked anyways with FastMM currently.

And other thing crossed my mind is that most likely the OmniThreadLibrary users would also gain from ScaleMM, if there are no too much depencies between the OTL and FMM...

-TP-

#110 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-12-22 11:42:51

ab wrote:

I compiled it with Delphi 2010. Previous versions will have problems with the record semantic.

I looked at it and it looked strange to me, but not sure a which point it was introduced...

I'll compile with D2010 at home...

-Tee-

#111 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-12-22 10:05:08

AdamWu wrote:

Please check out my latest revision:
http://code.google.com/p/delphi-toolbox … Free/?r=30

Could not compile, D6 don't open the project, dies in Access Violation (Something wrong in my installation). And D2007 gives internal error when trying to compile it sad So I can't compile and test it at all for now...

I try it at home, but if it would be possible to have compiled .exe, and some bat to run some standard "test suite", with various settings.

Maybe to modify the test program to write  Log on disk, to make posting into here easier...

-TP-

#112 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-12-19 07:51:24

AdamWu wrote:

I am quite interested to know which one runs faster.
But I don't have access to high core machines right now... sad
Would anyone be intested in testing out the code for me?

Put compiled test Exe(s) somewhere so I can run them, I have i7 980x. I am very interested into test this...

-TP-

#113 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-12-02 13:13:35

Oops,

I was more than less uninformative smile

I mean .exe compiled version of test/bechmark tool, so I could test them more easily (see the difference on my machine(s))

Sorry for that, I need to concentrate more wink

-Tee-

#114 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-12-02 11:44:20

Hello,

Could you send me compiled versions of those (easier to test on my machines). Or put them into some public place for download.

-TP-

#115 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-11-29 08:19:28

ab wrote:

I knew about the Fastcode MM challenge, but didn't take a look at this one since years, because it was not benchmarking MM on multi-core CPU at this time. Scaling was not a problem, and FastMM4 was winning most challenges.

Maybe it would be worth to add multithreaded test into it wink

-TP-

#116 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-11-29 07:09:22

andrewdynamo wrote:

I found the FastCode MM Challenge this weekend, which contains good MM tests: I already fixed some small problems. Still some AVs wit realloc, hope to fix this soon.

I think that BV-tool would be very good starting point, it it passes, then you must be close...

-TP-

#117 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2010-11-26 12:50:48

Hello hello,

One question, if this is meant for small en medium blocks (most common) how it is going to scale with threads that use very large data blocks, think of handles large bitmaps?? Will it scale better than FastMM or is it the same?

-TP-

#118 Re: PDF Engine » Problem with ForceJPEGCompression » 2010-11-02 08:58:56

OK,

I need to add something else than Jpeg image, but I could change it into it. (I just Assign TBitmap into it)

I just tough it would compress all images as Jpeg if property set smile Because it says it'll Force it smile

Thanks for your support!!!

I'll look into it...

-TP-

#119 PDF Engine » Problem with ForceJPEGCompression » 2010-11-01 06:30:22

TPrami
Replies: 4

Hello,

I use TPdfImage to add HighResolution bitmaps to the (Pdf)Canvas (Not the VCL one).

Dow not matter which value I set for the ForceJPEGCompression (Tested values 0, 30, 60 and 90 (At least)). File will have exact same size, no matter of the value of the property.

I even made 850mb .pdf file, and compressed it with 7-zip and it compressed into about 8.5MB, so it definitely have some room for compression.

Same results with an .CompressionMethod    := cmFlateDecode;

Don't know will this lib support compressing images with (de)Flate/Zip/Zlib (What ever called wink )

Any ideas, is this an bug in library, or in my code??? What could cause this.

This is not an issue for me now, but maybe later it is... (so no panic, for me, just wondering wink )

And BTW. Could do some good to have comment like this in the code
0 = Disabled
1 = Low compression (Large files, good quality)
100 = High compression (Small files, poor quality)
(Or other way round, can't remember which way it was wink

-TP-

#120 Re: Enhanced System Run Time Library » Enhanced System Run Time for Delphi 7 and Delphi 2007 » 2010-10-29 11:36:40

Hello,

Would it be possible to have your new versions in some kind of test file or in .pas file. '

So I could check some out and maybe patch some D6 methods by hand etc... (Or D2007)...

Because Most likely I can't use whole update, but some could help me a lot...

-TP-

#121 Re: Low level and performance » LZO and SynLZ compression units » 2010-10-29 11:28:37

OK,

I forgot this totally,

Bug was between the screen and back of my head big_smile

Sorry about this, hope there would be native Stream "interface" in next release. So I would get rid of this "hack" wink

It is  very fast indeed, in memory compression especially wink Thanks for this!!!

-TP-

#122 Re: PDF Engine » Synose PDF engine 1.10 » 2010-10-27 18:33:33

Ok,

Is there some demo code, to loook at?

Thanks for your reply...

-TP-

#123 Re: PDF Engine » Synose PDF engine 1.10 » 2010-10-26 05:41:53

Hello hello,

Can I use this library to make Pdf, with high resolution image and transparent text and images on top of those images.

I need to have high resolution background images and have some text and transparent image on top of it...

Can I do this, and if, any tips?

.TP.

#124 Re: Low level and performance » LZO and SynLZ compression units » 2010-07-30 11:13:24

Sorry.

I making fool of my self... I'll get back when I get this sorted out big_smile

-TP-

#125 Re: Low level and performance » LZO and SynLZ compression units » 2010-07-30 10:58:13

Whoooa...

I did jump a gun. Found and Error (or stumble upon one). Now you really wan't the Test code wink

There is some serious problem. That is why I did see lot of problems before.

-TP-

#126 Re: Low level and performance » LZO and SynLZ compression units » 2010-07-30 10:24:24

ab wrote:

I don't think it could be useful to code LZ or LZO in pure C#. I suspect the gain in speed will be none compared to native standard zlib...

OK, my bad, I always mix up few things in .NOT world. I mean any .NET comptible implementation which I/we could use. Save or unsafe code, as long as it is working and fast is fine by me smile

ab wrote:

Could you provide me with a whole testing program source code? Perhaps the problem is not in your code, but mine! ... I need the whole testing program...

Seems that it was totally my error, made testing program tough, which maybe you could use also wink. In which Email address you would like to receive it (seems that this forum don't allow attachments)

-TP-

#127 Re: Low level and performance » LZO and SynLZ compression units » 2010-07-26 06:11:10

Hello,

I took the code from above for LZ-compression between streams and it works great, then I tried to make same code to work with LZO, and don't work. I just can't see what I am doing wrong here sad

  procedure LZODecompressStream(const Source, Dest: TStream);
  procedure LZOCompressStream(const Source, Dest: TStream);


procedure LZODecompressStream(const Source, Dest: TStream);
var
   Size: Integer;
   Buf, Tmp: Pointer;
   ComprSize: Integer;
begin
   Source.Read(ComprSize, SizeOf(ComprSize));
   GetMem(Tmp, ComprSize);
   try
     Source.Read(Tmp^, ComprSize);
     Size:= lzopas_decompressdestlen(Tmp);
     GetMem(Buf, Size);
     try
       Size:= lzopas_decompress(Tmp, ComprSize, Buf);
       if Size > 0 then
         Dest.WriteBuffer(Buf^, Size);
     finally
       FreeMem(Buf);
     end;
   finally
     FreeMem(Tmp);
   end;
end;


procedure LZOCompressStream(const Source, Dest: TStream);
var
   Size: Integer;
   Buf, Tmp: Pointer;
   ComprSize: Integer;
begin
   Size:= Source.Size;
   GetMem(Buf, Size);
   try
     Source.Seek(0, soFromBeginning);
     Source.Read(Buf^, Size);
     Size := lzopas_compressdestlen(Size);
     GetMem(Tmp, Size);
     try
       ComprSize := lzopas_compress(Buf, Source.Size, Tmp);
       Dest.Write(ComprSize, SizeOf(ComprSize));
       if Size > 0 then
         Dest.WriteBuffer(Tmp^, ComprSize);
     finally
       FreeMem(Tmp);
     end;
   finally
     FreeMem(Buf);
   end;
end;

Maybe more eyes can tell me how stupid I really am big_smile

btw. is there ompatible C# implementation of LZ or LZO?

-TP-

Board footer

Powered by FluxBB