Rainbow colors & Compress/Compact Environment variable
Posted: 25 Sep 2013 06:02
Hi to all,
I am developing a procedure that uses the kd-tree to store a ramp palette to be used to draw in a colored using findstr. I have found as already mentioned in the forum a noticeable slowdown of execution with the size of the environment.
1) I did not understand if there are any workarounds discovered by someone to overcome these problems. I've seen that before placing the variables in alphabetical position they are accessed very quickly. It 's so?
2) I saw that representations of numbers in the batch are redundant and so I wanted to develop a procedure to represent a number with less use of the environment and possibly create a compressed structure with access still kind of random. For example with partial decompression that is not solid compression.
3) You could implement a kind of memory managment with garbace collection that uses the strings up to 8kb?
an example
Result: http://i.imgur.com/Qkr5vc4.png?1
4) There is dithering?
Note: The character used are ALT+176, ALT+177, ALT+178, ALT+219 of the known 437 codepage. I edit in ANSI with notepad. I executed with codepage 850.
Einstein1969
I am developing a procedure that uses the kd-tree to store a ramp palette to be used to draw in a colored using findstr. I have found as already mentioned in the forum a noticeable slowdown of execution with the size of the environment.
1) I did not understand if there are any workarounds discovered by someone to overcome these problems. I've seen that before placing the variables in alphabetical position they are accessed very quickly. It 's so?
2) I saw that representations of numbers in the batch are redundant and so I wanted to develop a procedure to represent a number with less use of the environment and possibly create a compressed structure with access still kind of random. For example with partial decompression that is not solid compression.
3) You could implement a kind of memory managment with garbace collection that uses the strings up to 8kb?
an example
Code: Select all
@echo off& setlocal EnableDelayedExpansion&Goto :Init_System
Rem Tested on windows 7.
Rem Test1: Choose raster font 4x6 or 8x8, or Lucida console 10 or 6 whithout cleartype enable.
Rem Test2: Disabling ClearType and in System -> Advaced system Option -> Advanced ->
Rem Perfomance Configuration -> visual Effect and unselect "Smooth Edges of Screen Fonts" Check Box
Rem You may get this with LucidaConsole setting to 5
:Main
:: manual rainbow
call :color 04 "°±²Û" 4C "°±²Û" CE "°±²Û" EA "°±²Û" A2 "°±²Û" 21 "°±²Û" 15 "°±²Û" 50 "°±²Û"
Goto :EndMain
:: ( Begin Color Function
:color
(echo %~2\..\'
) > $$$.color.txt && findstr /a:%~1 /f:$$$.color.txt "."
Shift
Shift
If ""=="%~1" Goto :Eof
goto :color
:: ) End color Fuction
:Init_system
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a")
<nul set /p ".=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%" > "'"
Goto :Main
:EndMain
:: Clearing all garbage
del '
Goto :Eof
Result: http://i.imgur.com/Qkr5vc4.png?1
4) There is dithering?
Note: The character used are ALT+176, ALT+177, ALT+178, ALT+219 of the known 437 codepage. I edit in ANSI with notepad. I executed with codepage 850.
Einstein1969